Posts

Showing posts from May, 2012

pdo - PHP Catchable fatal error: Object of class could not be converted to string -

i lost here... after validating input create instance of message class , attempt insert data database: // send message $message = $this->model->build('message', true); $message->insertmessage($uid, $user->user_id, $title, $message); the method insertion straight-forward: // insert new message public function insertmessage($to_id, $from_id, $title, $body) { $sql = "insert messages (to_id, from_id, title, body, create_date) values (:to_id, :from_id, :title, :body, now())"; $sth = $this->db->prepare($sql); return $sth->execute([':to_id' => $to_id, ':from_id' => $from_id, ':title' => $title, ':body' => $body]); } however, upon submission end blank page , apache error log says: [tue jul 30 22:34:44 2013] [error] [client 127.0.0.1] php catchable fatal error: object of class framework\models\message not converted string in /var/www/p-lug/p-lu...

string - jQuery isotope sort price -

i'm not having luck in getting correct sorts pricing belive $ sign interfering cannot replace function work. my html <span class="field-content price">$486.15</span> my jquery function price : function( $elem ) { return parsefloat( $elem.find('.price').text().replace($, '') ); } for reason not seem removing $ sign. missing in function? im not sure if decimal point causing problems sort thanks in advance demo enclose $ in in quotes '$' price : function( $elem ) { return parsefloat( $elem.find('.price').text().replace('$', '') ); } demo function x ($elem) { return parsefloat($elem.replace('$', '')); } $('.price').each(function(){ $(this).text(x($(this).text())); });

iphone - IOS :Get UIImage Orientation inside a UIImageview with exif data? -

i rotating uiimageview , uiimage inside of it. want orientation of uiimage after rotating uiimageview . you can use myimage.imageorientation , give uiimageorientation. or if used uiimagepickerviewcontroller use delegate method "imagepickercontroller:didfinishpickingmediawithinfo:" in method can access info dictionary nslog(@"%d", [info objectforkey:@"orientation"]);

sql - Oracle PLSQL script for string concatenation -

i have database of sql queries, procedures etc. now have following sql statement concatenation operators. 'insert test_table(id, name)' || 'select id, name ' || ' my_table' i want when sql return insert test_table(id, name) select id, name my_table this sql example want remove concatenations , return simple sql. thanks if got question right looking eval make oracle evaluate string concatenation marks. try declare concatenetaed_sql varchar2(32000); result_sql varchar2(32000); begin concatenetaed_sql := '''insert test_table(id, name)'' || ''select id, name '' || '' my_table'''; execute immediate 'select ' || concatenetaed_sql || ' dual' result_sql; dbms_output.put_line(result_sql); end; and result insert test_table(id, name)select id, name my_table pl/sql procedure completed.

visual studio 2010 - How can I find out what debugger is attached to w3p.exe -

i'm trying setup debugging on class asp project in vs 2010, , in doing trying attach it's debugger w3p.exe. i'm using windows 7 64-bit , iis 7.5. i've used method few times before on machine. however, i'm finding time unable attach debugger. it's saying: unable attach process. debugger attached. but can't figure out might be. how can determine this? or else? i've rebooted pc , can't yet see signs of running looks debugger. setup in case helps, here's steps used setup environment, documented previous successful attempts: created new empty visual basic .net web (best create in c:\inetpub\wwwroot\, otherwise have security/acl issues when loading site). copied contents of site folder project folder. in solution explorer, selected show files not in project. selected files , right click , select: "include in project". under project properties -> web -> set use iis , start url http://mysite.local in hosts file point...

jQuery UI Draggable issue with containment option -

i'm trying have image inside div of same width draggable in limit of div. it's difficult explain 1 side of image (top or bottom) can leave div cannot have gap between edge of image , border of div. to resume image has same width of parent div height bigger part of image hidden. well here want do: http://jsfiddle.net/maxwell2022/derna/165/ it's working perfectly... because there nothing above div. if there gap between document , div, it's not working anymore. think draggable taking document reference top of image. start dragging image, image move , stuck top edge top of document: http://jsfiddle.net/maxwell2022/derna/164/ i don't know how can achieve containment option. cheers, maxime update another attempt relative positioning no luck: http://jsfiddle.net/maxwell2022/derna/166/ i found solution fix getting top position of parent div using offset() , add containment boundary. i'm not sure it's best solution looks it's work...

c++ - Calculate_CRC32 function. How do I convert it to calculating bytes and not bits -

i helping out friend of mine bit stuck , own c++ skills rusty. interest , curiosity quite picked this. shall try , explain best can. note 32 bit check. uint32_t crc32::calculate_crc32(const uint32_t* pldata, uint32_t llength, uint32_t previouscrc32) { uint32_t lcount; const uint32_t lpolynomial = 0x04c11db7; uint32_t lcrc = previouscrc32; unsigned char* plcurrent = (unsigned char*) pldata; lcrc ^= *plcurrent++; while (llength-- != 0) { (lcount = 0 ; lcount < llength; lcount++) { if (lcrc & 1) lcrc = (lcrc >> 8) ^ lpolynomial; else lcrc = lcrc >> 8; } } return lcrc; } now ilength number of bytes packet contains. pldata packet data needs checked. is, function works. works bit bit. needs improved work byte byte. genius c++ developers out there far surpasses knowledge. ideas helpful. in advance guys. read ross williams excellent tutorial on crcs , s...

Error query value is null when using "CASE WHEN ... THEN" in php mysql? -

i have 2 table c_users(id, name) 1 | peter 2 | micheal c_user_meta(user_id, meta_key, meta_value) 1 | c_user_level | 0 1 | last_login | 2013-07-31 14:33:24 2 | c_user_level | 1 2 | last_login | 2013-07-30 14:33:24 and query user last login c_user_level = 0 $sql = " select u.* , max(case when m.meta_key = 'c_user_level' m.meta_value end ) level, max(case when m.meta_key = 'last_login' m.meta_value end ) last_login c_users u left join c_usermeta m on m.user_id = u.id u.id >0 , (case when m.meta_key = 'c_user_level' m.meta_value end) = 0 , (case when m.meta_key = 'last_login' m.meta_value end) not null group u.id order last_login desc" and result: id | name | level | last_login 1 | peter| null | 2013-07-31 14:33:24 error why level of user_id ...

orm - Laravel insert into a model with multiple relationships -

i'm trying eloquent http://paste.laravel.com/fnq but fail @ second statement because first attempted insert without waiting. anyway insert model multiple relationships?

java - how to use getSession Method of openmeeting SOAP? -

hello have create web page , create web service in it. want use getsession , loginuser method of openmeeting soap .i have add when run web page,i can not result.i output below javax.xml.bind.jaxbelement@1f16ecc result = -35 looks error code of login method. need login using user of type admin or web-service level. usual user not work.

java - Trying to create a JTable with 2D vector and string array header, how do I do it? -

i'm returning errors jtable inserting 2d vector , string[] header... try { refreshvector(); } catch (exception j) { throw j; } string[] headers = {"id","brand", "item", "details", "qty", "code", "re-order"}; jtable tbl_display = new jtable(data, headers); jscrollpane scrollpane = new jscrollpane(tbl_display); scrollpane.setbounds(120,120,600,300); refreshvector method contains... public void refreshvector() throws exception { dbconnect conn = new dbconnect(); try { conn.connect(); } catch (exception p) { throw p; } rs = conn.getdata(); while(rs.next()) { vector<object> vec = new vector<object>(); vec.add(rs.getstring("id_product")); vec.add(rs.getstring("brand")); vec.add(rs.getstring("description")); vec.add(rs...

how to change text of label in asp.net dotnetnuke c# and display it on page? -

i want put error messages on page @ runtime using labels. so have done following type of code. protected void insertbutton_click(object sender, eventargs e) { //this.formview1.visible = false; //linkbutton1.text = "update successful - add page"; textbox txtauthor = this.formview1.findcontrol("txtpageauthor") textbox; textbox txttitle = this.formview1.findcontrol("txtpagetitle") textbox; textbox txttag = this.formview1.findcontrol("txttagname") textbox; label lblauthor = this.formview1.findcontrol("lblauthor") label; label lbltitle = this.formview1.findcontrol("lbltitle") label; label lbltag = this.formview1.findcontrol("lbltag") label; if (string.isnullorempty(txtauthor.text)) { lblauthor.text = "author name must entered"; valid = 1; } if (string.isnullorempty(txttitle.text)) { lbltitle.text = "page title must entered...

dynamic crm auto merge duplicate when doing import -

is possible auto-merge (for contact/account/lead) records considered duplicate? for example: set duplicate detection rule based on account name (exact match). i have excel file have 2 rows column headings (name|mobile phone|address 1 city) the data follows: tommy | [blank] | new york tommy | 31211 | [blank] i want after import, data automatically merged to: tommy | 31211 | new york. is possible out-of-the-box? if not, how can achieve it? there nothing "out of box" achieve you're desiring. but using code , wouldn't terribly difficult create custom workflow activity gets ran on create of entity and checks see if duplicate of existing entity (not sure of how constrain import if didn't want run time) if so, performs merge logic in link provided

android - Launching activity on tapping in EditText box -

by default in android whenever user tap on edittext box , keyboard pops . i want whenever user tap on edittext box,it launches activity along keyboard(keyboard thing handled framework) . for have override edittext onfocuschangelistener edittext edittxt = (edittext) findviewbyid(r.id.youredittext); edittxt.setonfocuschangelistener(new onfocuschangelistener() { @override public void onfocuschange(view v, boolean hasfocus) { if (hasfocus == true) { intent intent = new intent(this, displaymessageactivity.class); startactivity(intent); } } });

debugging - Finding the cause of SIGSEGV in Xamarin.iOS app -

i'm working on first real app using xamarin.ios. of times app works great, few times day crashes following stacktrace: mono-rt: stacktrace: mono-rt: @ <unknown> <0xffffffff> mono-rt: @ (wrapper managed-to-native) monotouch.foundation.nsobject.monotouch_release_managed_ref (intptr) <il 0x00023, 0xffffffff> mono-rt: @ monotouch.foundation.nsobject.releasemanagedref () [0x00000] in /developer/monotouch/source/monotouch/src/foundation/nsobject.cs:98 mono-rt: @ monotouch.foundation.nsobject/nsobject_disposer.drain (monotouch.foundation.nsobject) [0x00062] in /developer/monotouch/source/monotouch/src/shared/foundation/nsobject2.cs:545 mono-rt: @ (wrapper runtime-invoke) <module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <il 0x00050, 0xffffffff> mono-rt: @ <unknown> <0xffffffff> mono-rt: @ (wrapper managed-to-native) monotouch.uikit.uiapplication.uiapplicationmain (int,string[],intptr,intptr) <il 0x0009f, 0xff...

grails - Why does clean compile "test-app -unit -integration" run tests twice? -

in jenkins job, grails target does: clean compile "test-app -unit -integration" and outputs tests results twice. i check .jenkins/jobs/myjob/target/test-reports and there xml corresponding tests there no duplication. likes executes once. same console log - can see test execute once. however, when @ build results on jenkins tests duplicated. i go to: .jenkins/myjob/builds/buildnumber/junitresult.xml and can see tests duplciated in this. so if when jenkins creates junitresult.xml file copies tests. any ideas why?

php - Unable to access cookie after page redirect -

i setting cookie containing vlue in format , redirecting page via php header function. here's code, setcookie("mycookie", $cookievalue, time() + $cookielife, "/"); // cookielife expiration time in sec header("location: $baseurl/index.php"); // $baseurl "http://localhost/mysite" the cookie getting set within browser. however, unable access cookie value in redirected page, i.e., "index.php". trying access cookie value simple echo this, echo $_cookie['mycookie']; however instead of cookie value, following notice, notice: undefined index: mycookie in /path/to/my/site/index.php on line 1 i have set cookie path "/" after looking @ other solutions still unable solve this. any appreciated. edit : testing on xampp server, , "mysite" here alias location on hard drive. causing issue? i assume cookie gets removed or dissapears once you've left previous page. check if time() + $coo...

objective c - Add edit functionality in contacts in iOS using Addressbook -

i'm trying create simple create, display , edit contacts in xcode 4.2 ios using addressbook, far have done create , display function. need implement edit function along display. when click on display displays contacts , when click on name shows info button , cancel button. need change cancel button edit , call edit functionality. below code of viewcontroller.m have done far. appreciate if u give me solution. #import "viewcontroller.h" #import <addressbook/addressbook.h> enum mainmenuchoice { menudisplaycontacts, menucreatecontacts }; @implementation viewcontroller @synthesize menuarray; - (void)viewdidload { [super viewdidload]; nsstring *plistpath = [[nsbundle mainbundle] pathforresource:@"menu" oftype:@"plist"]; nslog(@"%@",plistpath); self.menuarray = [nsmutablearray arraywithcontentsoffile:plistpath]; } - (void)viewdidunload { self.menuarray = nil; } #pragma mark table view methods - (ns...

android - code for time limit and intent other class -

can me example code of time limit. can here show complete code how implmeent or have time limit in 1 class intent in next class if user didnt click button. scenario- within 5 sec user must click button intent in class if reached 5 sec time limit intent mainmenu.class - game must fast clicking buttons :) hope can me a.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { toast.maketext(getapplicationcontext(),"correct!", toast.length_short).show(); intent intent = new intent(getapplicationcontext(),easytwo.class); startactivity(intent); an intent object reference can modified other java object create instance variable of intent object intent intent ; assign class value want assign intent = new intent(getapplicationcontext(),easytwo.class); use count down timer check if 5 seconds have passed or not , if passed assign instance...

haskell - Adding a new constructor to a datatype after declaration -

i have requirement add new constructors datatype after it's module has been loaded. pseudo code may seem this: import mymodule data mytype = newconstructor in above example mytype has been defined in mymodule . there way that? you can't. datatype closed. , thing otherwise, how can predict how previsouly defined function behave? several workarounds exist, here off top of head: use function constructor. e.g. myextendedtype = mytype 42 ; use own type , mapping function. e.g. data myextendedtype = myextendedtype; tomytype myextendedtype = mytype 42 ; wrap existing datatype: import mymodule old data myextendedtype = fromold (mytype int) | myextendedtype foo (fromold m) = old.foo m foo myextendedtype = undefined

c++ - reading standard output via read function instead of fread -

i program read standard output produced application. aware can use popen , use fread read output. do know whether possible use read (and possibly open )? working in linux c/c++ you can file descriptor read() calling int fd = fileno(fp) file *fp have got popen() . aware must not mix calling read() , fread() ! edit if want avoid popen() , have use pipe() , fork() , exec..() , dup2() it's done here

mapreduce - Cassandra Hadoop map reduce with wide rows ignores slice predicate -

i have wide row column family im trying run map reduce job against. cf time ordered collection of events, column names timestamps. need run mr job against specific date range in cf. when run job widerow property set false, expected slice of columns passed mapper class. when set widerow true, entire column family processed, ignoring slice predicate. the problem have use widerow support, number of columns in slice can grow large , consume memory if loaded in 1 go. i've found jira task outlines issue, has been closed off "cannot reproduce" - https://issues.apache.org/jira/browse/cassandra-4871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel im running cassandra 1.2.6 , using cassandra-thrift 1.2.4 & hadoop-core 1.1.2 in jar. cf has been created using cql3. its worth noting occurs regardless of whether use slicerange or specify columns using setcolumn_names() - still process of columns. any massively appreciated. so seems des...

objective c - UITableView -cell buttons not showing up -

at 1 point cell buttons showing when scroll view wider. made smaller , buttons have disappeared. i've played around frame doesn't seem work. suggestions? - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell = [[[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifier]autorelease]; uibutton*button= [uibutton buttonwithtype:uibuttontypecustom]; button.frame = cgrectmake(10.0, 0.0, 20,20); [button settitle:@"tap" forstate:uicontrolstatenormal]; button.backgroundcolor= [uicolor blackcolor]; [button addtarget:self action:@selector(buttontapped:) forcontrolevents:uicontroleventtouchupinside]; cell.accessoryview = button; [cell.contentview addsubview:button]; }...

c# - Entity Framework 5 - Local BindingList - Filtering? -

hopefully can point out how this: i have winforms application uses entity framework. e.g. have data bound gridcontrol via repository delivers bindinglist. e.g. (simplified code) class productrepository { public void loadall() { _context.products.where(p => p.deleted == false).load(); } public bindinglist<t> getbindinglist() { loadall(); return _context.products.local.tobindinglist(); } } class productlistpresenter { private void setlist() { _view.setlist(productrepo.getbindinglist()); } } class productlistview { deletedbutton.click += { (bindingsource1.current product).deleted = 1; gridcontrol1.refresh(); }; } but: want display non deleted products (product.deleted == false). okay filter within repository load() method, how filter when bound control? can't bindingsource1.removecurrent() wipe entity , mark state.deleted.. another thing consider here is: have other things...

php - Partitioning of table in mysql for MYISAM eninge based on year -

i trying partition table based on year range. but i'm getting following error "#1503 - primary key must include columns in table's partitioning function". following query create table if not exists `t2123` ( `j_id` int(11) not null auto_increment, `u_id` int(11) not null, `w_id` int(5) not null, `p_id` int(5) not null, `s_p_id` int(5) not null, `p_t` tinyint(3) unsigned not null, `a_n` int(5) not null, `type` enum('gp','ngp','pgp','pagp') not null, `p_p` int(11) not null, `s_p` int(11) not null, `p_c` float not null, `s_c` float not null, `s_p_p_c` float not null default '0', `g_d` date not null, `datetimes` timestamp not null default '0000-00-00 00:00:00', `c_c` double default '0', `c_m` double default '0', `c_y` double default '0', `c_k` double default '0' , `c_total` double default '0' , `p_a` float default '0',...

css - How can I align a div element in existing content -

i explain little example here: i have html page content already, , without modifying content want insert some message (say inserting image) in middle of existing content leaving div @ top. take @ picture, before doing css work: http://i.stack.imgur.com/uhjbx.png description: image inserted in content @ top of content div @ top and after applying css, want place in between content, this: http://i.stack.imgur.com/67yff.png description: image inserted css aligned in middle of content div @ top html: <div class="myimg"> <img src=http://s14.postimg.org/miss2r3xt/html_css.jpg /> </div> <p>some paragraph </p> <strong>what html?</strong> <strong>what css?</strong> <p>some paragraph</p> css: .myimg { position: absolute; } here link simple example, trying modify @ jsfiddle . let me know if guys can help!!! for adding elements css, take @ :after et :before . for ex...

java - Why can't I add SuperType to List<T> where <T extends SuperType>? -

with public class supertype { } and public class testclass<t extends supertype > { public void dosomething() { list<t> list = new arraylist<t>(); list.add(new supertype ()); // error } } it won't compile, giving me the method add(t) in type list not applicable arguments (supertype) but why? assume have public class supertype { } public class subtype extends supertype { } and use testclass<subtype> code becomes public class testclass<subtype> { public void dosomething() { list<subtype> list = new arraylist<subtype>(); list.add(new supertype ()); } } that has error because new supertype() not specific enough. has @ least subtype .

c++ - Why doesn't SIGINT handler work in my code? -

i need command line application wait ctrl-c in main thread , execute deinitialization code , exit. i tested scenario following test program: #include <unistd.h> #include <signal.h> #include <cstdlib> #include <cstdio> #include <cassert> using namespace std; void control_break_handler(int) { printf("\ncontrol_break_handler\n"); } int main() { printf("%s", "before signal\n"); int result = 0; struct sigaction sigact = {}; result = sigemptyset(&sigact.sa_mask); assert(result == 0); sigact.sa_handler = &control_break_handler; sigact.sa_flags = 0; result = sigaction(sigint, &sigact, null); assert(result == 0); sigset_t set; result = sigemptyset(&set); assert(result == 0); result = sigaddset(&set, sigint); assert(result == 0); int sig; result = sigwait(&set, &sig); assert(result == 0); printf("\nsigwait returned %d,...

animation - Android onDraw loop -

i've set global variables x,y in activity class. i start thread "t0" continually update globals x , y. i have ondraw pseudocode follows (all on ui thread):- view.ondraw(){ if (x,y changed value) { x0=x; y0=y; loop (x0-- until x0==0){ canvas.drawbitmap(bmp, x0, y0, bitmappaint); invalidate(); } } } i hoping i'd see animation of bitmap moving across screen on x-axis, each invalidate() re-drawing new position. instead see 'jump' last x position 0 (no intermediate stages). i'm making assumption although x , y updating via t0, i'm not concerned since loop busy original x,y values (assigned x0,y0). i observe x,y updating , code executed inside 'if loop' (i see via debug). i tried adding delay, didn't seem make difference. can re-draw directly new x,y position, need smooth 'transition' via loop happen one-x0-coord another. any hints or tips appreciated. ...

How to avoid overlap view in relative layout in android? -

<scrollview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <relativelayout android:layout_width="wrap_content" android:layout_height="wrap_content" > <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparenttop="true" android:layout_alignparentleft="true" android:textsize="30sp" /> <textview android:id="@+id/textview2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/textview1" android:textsize=...

php - Converting a MySQL database row time timezone -

so have made ridiculously complicated accident because don't think can have individual timezones per database in mysql if they're on same account? basically of databases american users , use 1 of american timezones, run english blog. my issue english blog has correct bst (gmt+1) value inserted datetime row it's in database uses mdt timezone. i need time rss feed using: $date = date('r', $data['date']); //mdt system $data['date'] gmt+1 but gives me time in future @ time of blog post due incorrect timezone. is there way can convert bst mdt? but gets more complex because months of year in england use gmt (gmt+0) instead of bst (gmt+1) ... there anyway work out timezone being used in england @ time of year , conversion or way overcomplicating whole matter? the following solution works perfectly: $olddate = date('l f j y h:i:s', $link['date']); $date = new datetime($olddate, new datetimezone('europe/london...

wpf - ComboBox DataTemplate Separator -

i'm trying create datatemplate class combobox displays 2 properties , separator. problem don't want see separator once selected item. current template looks this: <datatemplate datatype="{x:type j:person}"> <stackpanel> <textblock text="{binding nick}" fontsize="14"></textblock> <textblock text="{binding fullname}"></textblock> <separator/> </stackpanel> </datatemplate> another problem separator short, doesn't span entire combobox width. any appreciated. to stretch separator please use horizontalcontentalignment="stretch" on combobox . regarding hiding of separator help: displaying selected item differently in combobox .

c# - What happens internally when you bind to ItemSource? -

i'm curious how works, because have mainviewmodel , has property called subviewmodel has property of observablecollection (we'll call property1 .) i've implemented inotifychangedproperty on everything. my main window <window .. datacontext="{binding mainviewmodel}" /> ... <stackpanel datacontext="{binding subviewmodel}"> <local:somecontrol datacontext="{binding}" /> </stackpanel> </window> and usercontrol <usercontrol name="somecontrol"> <datagrid name="mydatagrid" itemsource="{binding property1, mode=twoway}" currentcellchanged="testmethod" /> ... </usercontrol> in test method, test figure out why changes not propegating main view model this private void testmethod() { var vm = this.datacontext subviewmodel; var itemsourceobservablecollection = mydatagrid.itemssource observablecollection<mytype>;...

How to integrate WebSync with ASP.NET MVC 4 -

as title said, want use websync , frozenmountain , with asp.net mvc 4 , haven't found tutorial it. know how that , where start ? or if have better way implement comet asp.net mvc 4, please let me know. thanks help. do know how that, start? the documentation first place might start @ when need apprehend new tool or framework not familiar with: http://docs.frozenmountain.com/websync4/ or if have better way implement comet asp.net mvc 4, please let me know. you might checkout signalr .

html - Bootstrap sticky footer with vertically centred content -

trying modify bootstrap's sticky footer example http://getbootstrap.com/2.3.2/examples/sticky-footer-navbar.html have vertically centred content, still fail that. the full code below. i'm trying vertically align part between "begin page content" , "end page content" comments. would appreciate help. <html lang="en"> <head> <meta charset="utf-8"> <title>sticky footer &middot; twitter bootstrap</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <!-- css --> <link href="../assets/css/bootstrap.css" rel="stylesheet"> <style type="text/css"> /* sticky footer styles -------------------------------------------------- */ html, ...

ravendb shardstrategy & shardeddocumentstore -

can choose have few objects sharded, typically have potential have large amount of data , leave others stored across instances? for example when have banking transaction, might want store customers , transactions in different shards , might want store list of bank branches in databases. possible? you can that, not in single database. way works, have 2 databases on each server (and 2 document stores) 1) sharded, transactions & customers 2) standard, banks. the banks database replicated nodes.

ios - IBM Worklight 6.0 - AutohideSplashScreen has no effect -

i have ported project worklight 6.0. used autohidesplashscreen far, not seem have effect in 6.0. easy reproduce: create new project ipad environment set autohidesplashscreen false in config.xml deploy , run -> splash screen disappears automatically this important because app has ugly flicker on startup. is there workaround proper splash screen handling again? this known. worklight @ moment disregards option , splash screen set disappear after web resources have been loaded. i cannot comment on future plans, true current situation not ideal , we'd address. to knowledge there no workaround.

php - Sum of column equals, A - B -

this may straight forward one. i'm playing around little app i'm trying create. i've got form users submit "buy_price" , "sell_price". trying work out if have made loss or profit. better have column within database works out "margin" i.e "margin coulmn = sell_price-buy_price" (and how this). or better within php. thank in advance. dan edit: use database because store data , can view purchase history. want make section such "best trades" ones highest margin etc. i absolutely not store calculated values in database simple - maintenance outweigh marginal gains in efficiency. even without storing value, still have option on whether calculate value upon retrieval (with mysql ) or php when rendering. select buy_price, sell_price, (buy_price - sell_price) margin x sql aside, i'd still go calculating upon render php .

java - How to exclude transitive dependency -

i use javamail in same project cxf. cxf brings older version of javamail not suit me. how excluded? did so: compile (group: 'org.apache.cxf', name: 'cxf-rt-bindings-soap', version: apachecfxversion) { exclude module: 'geronimo-javamail_1.4_spec' } but did not help. find in war web-inf \ lib \ geronimo-javamail_1.4_spec-1.6.jar try this: configurations { all*.exclude module: 'geronimo-javamail_1.4_spec' }

How i work with mongodb in ruby on rails -

how use mongodb in ruby on rails, how run rake command? step step? please tell me scaffold example. i'm beginners in ror. ............................................................................................................................................................................................................................................................................................................................................................................................. take @ mongoid if beginner, recommend start studying ruby before jump rails

c# - How to maintain Form request value when page is refresh -

when post value form submit request on redirect action after refresh redirected page posted value lost.how maintain request value when page refresh. to persist value(s), use: session variables, cookies, or query string values.

javascript - transaction.executeSql Success function error -

i did function select data db , show alert, i'm getting following error in success function: cannot read property 'rows' of undefined retrievedata here functions function selectall(){ db.transaction( function(transaction) { transaction.executesql("select * cdprodutos", [], retrievedata()); //the retrievedata function data sent/returned in parameters (transation, results) }); } function retrievedata(transaction, results) { for(var = 0; < results.rows.length; i++) { var data = results.rows.item(i)['id'] alert(data.value); } } it looks function being executed , there no data being passed it, rows property coming undefined. writing () after retrievedata , invoking function immediately. remove () use callback. it appears need pass data along it, anonymous function trick here: function selectall(){ db.transaction( function(transaction) { transaction.executesql("select...

iphone - uialertview don't do action -

i have put alert view 2 buttons, buttons don't open urls. don't know error. please. here's code: -(ibaction)showalertview { uialertview *alert = [[uialertview alloc] initwithtitle:@"obrir en..." message:@"es pot requirir la aplicació de google maps" delegate:self cancelbuttontitle:@"millor no..." otherbuttontitles:@"mapes",@"google maps",nil]; [alert show]; } - (void)alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex { nsstring *title = [alertview buttontitleatindex:buttonindex]; if([title isequaltostring:@"mapes"]) { uiapplication *ourapplication = [uiapplication sharedapplication]; nsstring *ourpath = @"http://maps.apple.com/?q=plaça+del+rei+43003+tarragona"; nsurl *oururl = [nsurl urlwithstring:ourpath]; [ourapplication openurl:oururl]; } if...

maven 2 - Spring 3.2.3 : activemq 5.5 dependency problems -

i'm trying upgrade project spring 3.2.3, spring 3.0.7. i'm stuck on problem activemq dependencies , can't figure out jar need or conflicting in first place. following stacktrace org.unitils.core.unitilsexception: unable create application context locations [classpath:producerservicecontext-test.xml] @ org.unitils.spring.util.applicationcontextmanager.createinstanceforvalues(applicationcontextmanager.java:121) @ org.unitils.spring.util.applicationcontextmanager.createinstanceforvalues(applicationcontextmanager.java:36) @ org.unitils.core.util.annotatedinstancemanager.getinstanceimpl(annotatedinstancemanager.java:234) @ org.unitils.core.util.annotatedinstancemanager.getinstance(annotatedinstancemanager.java:121) @ org.unitils.spring.util.applicationcontextmanager.getapplicationcontext(applicationcontextmanager.java:65) @ org.unitils.spring.springmodule.getapplicationcontext(springmodule.java:235) @ org.unitils.spring.spri...

ios - Can you install an Android Device Simulator in xcode when using Apportable -

can install android device simulator in xcode when using apportable convert ios app android or need android device compile , run project? dont have android device , wanted test before go buy one. thanks note easier work android device emulator, possible use emulator: ~/.apportable/sdk/toolchain/macosx/android-sdk/tools/android launch android tool can create avd's. make sure install arm eabi v7a system image, create avd target of api level 17, cpu/abi of arm (armeabi-v7a), sd card size of around 500 mib, choose builtin skin of wvga800, select hardware features of abstracted lcd density of 240, max vm application heap of 48 , device ram size of @ least 512, internal storage should @ least 500 mib. , of make sure check box use host gpu. to run emulator: dyld_library_path=~/.apportable/sdk/toolchain/macosx/android-sdk/tools/lib/ ~/.apportable/sdk/toolchain/macosx/android-sdk/tools/emulator-arm -avd emulator -gpu on this launch android emulator (note: take bit l...

Rails create and destroy nested attributes on update model form -

i have products model has_many :tags . the tags created on product creation. when update product, can update attributes, including tags' attributes. but question is, how can i, remove tag or create 1 when update product on product update form? do have create separate tag form or that? here update product form: <%= form_for(@product), id: 'edit_form' |f| %> <div class="field"> <%= f.label :name %><br> <%= f.text_field :name %> </div> <div class="field"> <%= f.label :description %><br> <%= f.text_area :description %> </div> <div class="field"> <%= f.label :location %><br> <%= f.text_field :location %> </div> <div class="field"> <%= f.label :price %><br> <%= f.text_field :price %> </div> ...

.net - How to Convert Row to Column in Linq and SQL -

Image
i have table called languagemaster having below record language keyname keyvalue english city aa swedish city aaswedish german city aager chines city aachines french city aafr spanish city aaspanish how convert languagemaster table below table keyname english swedish german chines french spanish city aa aaswedish aager aachines aafr aaspanish please let me know how write query in both sol , linq. update : created following generic method can build pivot table collection public static datatable topivottable<t, tcolumn, trow, tdata>( ienumerable<t> source, func<t, tcolumn> columnselector, expression<func<t, trow>> rowselector, func<ienumerable<t>, tdata> dataselector) { datatable table = new datatable(); var rowname = ((memberexpression)rowselector.body).member.name; table.columns.add(new datacolumn(rowname)); var colu...

vba - Excel Macro - Search Range of Cell for 0, then return "empty" cell -

this first time using forum, , vba skill not developed. hope can help. i have 2 columns of data, column a , column b . column a - returns sequential "month-year" or 0. if spreadsheet current date (=now()) less feb, cell february returns 0. column b - want column check each cell in column a. if column cell has date identifier, want placed in column b. if column has 0 identifier, want column b return "empty" cell. reason why doing graphing bar chart. when trick program making empty cell (x-axis) graph not show data month (which want). trying make dynamic graph, have no experience in vba (only c programming =/). you don't need vba (or formulas) this. highlight column (the entire column), copy it. highlight column b (the entire column, right click, paste special, select values , number formats, okay. highlight column b again. press ctrl+h, type 0 (or failing might 00/01/1900) in 'find what', leave 'replace with' 1 blank. tick...

Download .csv with javascript -

i want generate .csv in javascript. have object, name "archivo". problem when generate file csv, in each line add ',', don't know happen archivo=[], each line string + '\n'. if (navigator.appname == 'microsoft internet explorer') { var popup = window.open('','csv',''); popup.document.body.innerhtml = '<pre>' + archivo[i] + '</pre>'; }else{ location.href='data:application/download; charset=utf8,' + encodeuricomponent(archivo); } any can me? you should consider using csv generator library, handles you. i've written light-weight client-side csv generator library might come in handy. check out on http://atornblad.se/github/ (scroll down headline saying client-side csv file generator ) it requires functioning filesaver implementation handling calls window.saveas() . check out e...

php - Form submit not displaying message -

i have html form id of newticket , jquery in head section of page: <script type="text/javascript"> $(document).ready(function(){ $("#message").hide(); $("#newticket").submit(function(e){ e.preventdefault(); datastring=$("#newticket").serialize(); $.ajax({ type: "post", url: "newticket_go.php", cache: false, data: datastring, success: function(res){ //$("#message").show(); $("#message").html(res); $('#message').fadein('slow'); if(res.indexof("success")!=-1) { window.location.href = res.substr(8); } } }); }); }); </script> i have <div id="me...

jquery - How can I prompt user to rotate device if in a certain mode landscape or portrait, similar to GameInformer App -

Image
i have website best viewed in landscape mode. how can have if user loads website in landscape mode fine if loads in portrait mode or rotate landscape portrait mode image or popups taking entire screen asking them rotate landscape? thinking javascript/jquery can this. i have seen done on ipad game informer app if user opens app in portrait or rotates landscape portrait opaque image pops asking them rotate landscape. [see ipad screenshot] instead of jquery/js can use css styled div container instead, shown when device in portrait mode. you can catch orientation media query example: /* screens */ #info {display: none;} /* when orientation in portrait mode */ @media , (orientation:portrait) { #info { display: block; } }