Posts

Showing posts from March, 2011

magento - How do I add letters prefix before my order number? -

all im trying add few letters before order number in magento, @ default 100000001, 100000002, etc i'm wanting like,td10000001, td10000002, i've checked out several tutorials need edit the: mage_eav_model_entity_increment_numeric function there doesn't seem decent tutorial telling me how this. any appreciated. answered, found awesome free plugin mswebdesign allows prefixes before order number wanted, hope helps else.

entity framework - Cannot Find ASP.NET Identity Tables in Database -

Image
i created database using using ef code-first migrations approach. when ran application registered user , expected identity tables added database created couldn't find tables. checked connection string sure rightly set. please have missed out? please help. edit: code context. public class appdatacontext : dbcontext { public appdatacontext() : base("appconnection") { } public dbset<appuser> appusers { get; set; } public dbset<attendance> attendances { get; set; } public dbset<classinfo> classes { get; set; } public dbset<enrollment> enrollments { get; set; } public dbset<messageboard> messageboards { get; set; } public dbset<notification> notifications { get; set; } public dbset<notification_user> usernotifications { get; set; } public dbset<notificationtype> notificationtypes { get; set; } public dbset<parent> parents { get; set; } public dbset&l

How to resolve MySQL error "Cannot delete or update a parent row: a foreign key constraint fails"? -

cannot delete or update parent row: foreign key constraint fails (`sponge`.`taxonomy`, constraint `taxonomy_ibfk_1` foreign key (`organism_id`) references `organism` (`organism_id`)) i getting error while deleting entire record. actually wanted deleted entire record table associated organism_id in sponge db. my organism table is:- create table if not exists `organism` ( `organism_id` int(11) not null auto_increment, `experts_id` int(11) not null, `literature_id` int(11) not null, `genus` varchar(255) not null, `species` varchar(255) not null, `scientific_name` varchar(255) not null, `organism_type` varchar(255) not null, `author_org` varchar(255) not null, `found_year` varchar(255) not null, `curated_year` date not null, `curated_status` varchar(10) not null, primary key (`organism_id`) ) engine=innodb default charset=latin1 auto_increment=60 ; and taxonomy table is: create table if not exists `taxonomy` ( `taxonomy_id` int(11) not nul

ios - UITableView is 8 points wider than UIViewController -

Image
i'm adding uitableview uiviewcontroller using interface builder. setting leading, trailing, top , bottom constraints superview margins somehow makes tableview 8 points wider viewcontroller. here's view hierarchy: the constraints: viewcontroller view during runtime using xcode visual debugger: tableview during runtime using xcode visual debugger: the 8 points seems suspicious , picture has margins, though i'm not able figure out. why tableview wider viewcontroller? uncheck before u give constraint

Java - Why I can't enumerate certificates in a KeyStore by using their alias? -

keystore keystore_client = keystore.getinstance("pkcs12"); try(inputstream keyinput = new fileinputstream("2.pfx")){ keystore_client.load(keyinput, null); } enumeration<string> e = keystore_client.aliases(); while(e.hasmoreelements()){ string alias = e.nextelement(); if(keystore_client.getcertificate(alias)==null) throw new runtimeexception("cannot certificate"); } when run code, exception: "cannot certificate" . how can extract certificates pkcs12 file? edit: pfx file created openssl. $ openssl pkcs12 -export -out 2.pfx -in server.crt -inkey server.key $ keytool -list -keystore 2.pfx enter keystore password: ***************** warning warning warning ***************** * integrity of information stored in keystore * * has not been verified! in order verify integrity, * * must provide keystore password. * ***************** warning warning warning ***************** keystore typ

java - lwjgl glDrawArrays gives Invalid operation error -

when learning how use opengl 3.2 through lwjgl, followed tutorial @ here . keep getting invalid operation error on method call gldrawarrays. error occurs if copy source code tutorial. my operating system mac os x 10.8.3 , after quick search not turn anything. my code(adapted code tutorial): render method: public void render() { gl11.glclear(gl11.gl_color_buffer_bit); // bind vao has information quad vertices gl30.glbindvertexarray(vaoid); gl20.glenablevertexattribarray(0); this.exitonglerror("error before drawarrays"); // draw vertices gl11.gldrawarrays(gl11.gl_triangles, 0, vertexcount); this.exitonglerror("error in drawarrays"); // put default (deselect) gl20.gldisablevertexattribarray(0); gl30.glbindvertexarray(0); this.exitonglerror("error in render"); } rest of code: import java.nio.floatbuffer; import org.lwjgl.bufferutils; import org.lw

winapi - Is there any way to make the DialogProc work without declaring as Nonstatic -

i have developed button application using createdialogparam , dialogproc. first declared dialoproc method static in order make every thing work fine , worked situation there many variables(not globally declared) , functions have use inside dialogproc function , want make non static because making static makes me not implement few more things. if don't declare static gives error m_hwndpreview = createdialogparam( g_hinst,makeintresource(idd_maindialog), m_hwndparent,(dlgproc)dialogproc, (lparam)this); //('type cast' cannot convert 'overloaded-function' //to 'dlgproc') is there solution make dialogproc function without declaring static ??? it must static function because windows calls c code, not c++ code. there several ways static function can retrieve 'this' pointer saved somewhere, use pointer call class member function. every gui library available windows solves problem: consider using one.

php - Yii2 delete confirmation modal -

i'm trying make delete confirmation modal yii2. have grid view action button deletes item of gridview. when user clicks on button, popup modal shows , cannot id of item must deleted. here code of gridview (only action button): 'buttons' => [ 'view' => function ($url, $model) { return html::a('', $url, ['class' => 'btn btn-success btn-xs glyphicon glyphicon-eye-open']); }, 'edit' => function ($url, $model) { if (yii::$app->user->getidgroupe() != 1) { return html::a(''); } return html::a('', $url, ['class' => 'btn btn-warning btn-xs glyphicon glyphicon-pencil']); }, 'delete' => function ($url,

asp.net mvc 4 - How to call ASP MVC CSHTML View directly with ".cshtml" extension from browser -

i want call asp mvc cshtml view directly browser ".cshtml" extension like: www.mysite.com\receive.cshtml?... instead www.mysite.com\receive?... but got 404 any idea ? 1. default iis request filtering configured not serve requests .cshtml files. 2. razor views not meant accessed directly client. yet, take @ https://github.com/servicestack/razorrockstars

html5 - Bootstrap - need of "col-sm-12"? -

simple question - <div class="col-sm-12"> needed? example 1: <div class="row"> <h1>title</h1> <div class="col-sm-6"> half </div> <div class="col-sm-6"> half </div> </div> example 2: <div class="row"> <div class="col-sm-12"> <h1>title</h1> </div> <div class="col-sm-6"> half </div> <div class="col-sm-6"> half </div> </div> what better , why? thank you. all bootstrap grids works second example. .row element have negative margin compensate positive padding in .col-* elements. it´s better , more logical second example. in first example, haven't got paddings of .col-* elements , negative margin produce unexpected results. example col-sm-12 : <link href="//maxcdn.bootstra

javascript - Bootstrap input-group text without button taking half the space -

i don't know if supposed behaviour or not, i've come across weird input-group . when there text input inside it, textbox smaller when there button. see jsfiddle: https://jsfiddle.net/dtchh/20367/ is normal ? since you´re not grouping think considered normal. adding input addon extends. see fiddle: https://jsfiddle.net/dtchh/20370/ <div class="input-group"> <!-- input group addon --> <span class="input-group-addon" id="basic-addon1">@</span> <input type="text" class="form-control"> </div> also read http://getbootstrap.com/components/#input-groups

file storage - Laravel 5.2 filename appending index number -

i have simple dilema using laravel 5.2 . want store files in directories. there 2 steps need do: check if filename not taken already. if filename taken, append index number dash filename: "_1" if "_1" taken, filename should append "_2" etc. how can this? just use simple loop: $file_name = "file"; $ext = "jpg"; $i = 0; $original_file_name = $file_name while (file_exists("{$file_name}.{$ext}")) { $i++; $file_name = $original_file_name . '_' . $i; }

javascript - How to check empty object in angular 2 template using *ngIf -

i want check if object empty dont render element, , code: <div class="comeback_up" *ngif="previous_info != {}"> <a [routerlink]="['inside_group_page',{'name':previous_info.path | dottodash }]" > {{previous_info.title}} </a> </div> but code wrong, best way this? this should want: <div class="comeback_up" *ngif="(previous_info | json) != ({} | json)"> or shorter <div class="comeback_up" *ngif="(previous_info | json) != '{}'"> each {} creates new instance , ==== comparison of different objects instances results in false . when convert strings === results true plunker example

java - Interservlet communication -

i have websocket servlet , rest servlet. want inform websocket servlet changes in order write these "events" via websocket server. i find forward() , include() approach. seem me can forward onget, onpost, etc. do miss something? indeed, forward() , include() meant used when processing request. might not best option given want achieve. what create third component, let's call eventmanager time being, , have rest servlet signal changes eventmanager . websocket, on other hand, notified eventmanager new data available , new data in order write client. in approach essential both rest servlet , websocket servlet share same instance of eventmanager . achieve marking eventmanager singleton ejb adding @singleton annotation, , inject both rest servlet , websocket servlet.

android - How to close app/activity or code menu item via intent/pendingIntent in Chrome Custom Tabs -

i'm trying understand how chrome custom tabs work. following guidelines, adding custom item menu done using pendingintent, such as: intent intent = new intent(intent.action_view, uri.parse("http://google.com")); pendingintent pendingintent = pendingintent .getactivity(this, 0, intent, pendingintent.flag_update_current); customtabsintent = new customtabsintent.builder() .addmenuitem("visit google website", pendingintent) .build(); i know how use pendingintent direct website or create 'share' action. question possible more complex tasks adding 'close' menu item close activity or exit app; or 'connect' menu item method, when user clicks on code method process. guess second if possible make easy solution first. i tried search answers, if search how close or end activity or app (or similar) using intent or pendingintent, use of 'finish();' or 'startactivity(intent);' or similar, cannot apply

Morris area chart jquery/php -

Image
i have problem morris chart. tried many times , in many different ways create morris area chart data situated in html table failed. this way used extract data table: $('.tabella_dati').click(function () { var table = $("#datatbl tbody"); var $data = table.find('tr').each(function (i, tr) { var righe = $('td', tr).map(function (i, td) { return $(td).text(); }); var $ciao = json.stringify(righe); $.post('charts', {data: $ciao}, function (data) { alert(data); }); }).text(); i tried , without post method. post method tried create chart in php function in way: function morris() { $data = input::get('data'); echo '<script>morris.area({element: "morris-area-chart",' . 'data: '.$data.'}, xkey: '.$data.', ykeys: '.$data.')</script>'; xkey , ykeys wrong, know. sorry

c# - How to disable postback or encoded query string ASP.NET -

Image
i have application button on page postback or maked encoded url (like yellow highlight) if clicked. how disable that? but if make simple web form, sample button. working normally, not showing encoded url again. : note : use netframework 4.6 it seems me, make "get"-request. please check "method" attribute of form-tag , set "post" instead of "get". it should <form id="aspnetform" runat="server" method="post" > regards, sebastian

c++ - Correctly formatting the output -

my software has show end result user, data received though uart port, need format , round data. i did write algorihtm that, feeling there has better solution. my output can have mutiple ranges, need round , format correctly. example: 1 of many results go -> 0.000 ohm 2.000 ohm 2.01 ohm 20.00 ohm 20.1 ohm 100.0 ohm 100 ohm 200 ohm i made simple structure hold basic data formating struct _range { float from; //0.000 first example float to; //2.000 int decimal; //3, decimal places need int unit; //unit format, ohm in example float div; //sometimes need divide result @ range //example, when reach 1000va need divide 1000 1kva }; i have static function called addunittoresult, 1 add unit result. now asking me write function correctly format result string , round double ( need double later compare ). correctly format means if result 0, should format 3 dedimal places. i hope can me guys edit: this have handle round , dividing. void resultbo

Antlr4: testing C#-parser -

is there grun ( org.artlr.v4.runtime.misc.testrig ) antlr4cs? ( https://github.com/tunnelvisionlabs/antlr4cs ) i avoid generating java code, able test grammar. opened grammar , test-input file in antlrworks2 — did trick , showed parse-tree (select tab grammar, “run” -> “run in testrig…” -> choose input file , start rule).

android - How to open sms app via implicit intent? -

i follow code: intent intent = new intent(intent.action_main); intent.addcategory(intent.category_default); intent.settype("vnd.android-dir/mms-sms"); startactivity(intent); it work android 5.1, doesn't work android 6.0, because android.content.activitynotfoundexception: no activity found handle intent . so, how open sms app via implicit intent? edit: you read post? need open app, not send message. i check this post, doesn't work! you can try this, work me: intent intent = new intent(intent.action_main); intent.addcategory(intent.category_app_messaging); startactivity(intent);

Find column Vbscript PowerDesigner -

i find column in tables. why have mistake when run vbscript in power designer? dim table, column each table in activemodel.tables each column in table.columns output column.name next next mistake object doesn't support property or method: 'columns'.

angular - Submenu with angular2 -

i have menu on left side of page , there has menu on left submenu of selected menu. work i've created non-terminal route '/section/...' , created component router outlet in it. component in "section" folder router component. had use links make work (the "./" had added here links specific subcomponent): <a [routerlink]=" ['./index'] ">index</a> <a [routerlink]=" ['./test'] ">test</a> everything works perfectly, turn hrefs submenu separate component. don't want hardcode menu in every section, i'd rather place tag , somehow specify links added submenu. problem here i'm stuck , don't know how pass links submenu component still point correct locations. best way create such submenu component , pass list of links it? i solved similar use case using single parameter of route menu path , other part of path actual content route path like http://myapp/main_menu.sub_menu

ios - Benchmarking CoreData and Realm -

how can benchmark coredata , realm? i've used unit testing , took more time realm database add 100,000 records of data compared coredata (which believe incorrect) , no didn't use inmemory because i'm concerned benchmarks being close reality possible. so what's proper way benchmark database fetch/add/remove processes? xctest? instruments? if xctest way, must've been testing wrong. believe realm should outperform coredata in @ least simple databases. some general benchmarking questions: what compiler optimization level building with? building in "release" mode full optimizations best optimization setting closest match real world behavior you're seeing. are benchmarking in simulator or on real device? it's critical test on real ios device. how close benchmark code reflect real-world usage? synthetic benchmarks misleading unless great care taken reflect how libraries used in reality. example, realm's per-transaction overhead

relation - TYPO3: Reading tt_address and print it sorted by sys_categories with fluid in own extbase extension -

i want read contents of tt_address , print them sorted sys_categories in own extbase/fluid extension. i mapped both tables in typoscript, created models, controllers , repositories both , able print both tables complete without issues. however, need print adresses match category (depends on page) can't work. according research should posible load them , access them in fluid template like <f:for each="{cats}" as="cat"> <f:for each="{cat.items}" as="adr">{adr}</f:for> </f:for> but if display them via debug option there no adresses attached cat array - no wonder none displayed. i created tcas both tables m:m related column definition in (categories tt_address , items sys_categories) , included following in models: /** * addresses * * @var \typo3\cms\extbase\persistence\objectstorage<\vendor\myext\domain\model\address> */ protected $addresses; /**

Ionic 1.3 hides NavBar when caching is disabled -

i started working ionic , ran issue data not being updated on re-entering views. on finding more ionic, realized can disable caching view , ionic forced recreate view each time. however, when use $state.go('statename',{},{reload: true}) , ionic caching disabled, issue. my controller called twice view , navbar disappears. the same issue open @ ionic here . there has been discussion issue here on ionic forum. however, proposed solution of marking hide-nav-bar="false" not work me. with solution of $scope.$on('$ionicview.enter', function(e) { $ionicnavbardelegate.showbar(true); }); my navbar becomes visible no buttons, , also, controller being called twice. since should very common scenario app not need view caching, please share appropriate workaround figured out past this? thanks help! don't use {reload: true} in $state.go method update data in view because causing controller called twice. since ionic caches

c# - Magick.NET-Q16-AnyCPU and iis server -

i have issue: 1) i've downloaded magick.net-q16-anycpu throught nuget in vs2010. 2) i've created function read remote svg , convert itextsharp.text.image object below: itextsharp.text.image headeimage = null; using (magickimage image= new magickimage(linksvgremote)) { percentage percent = new percentage(55); image.resize(percent); headeimage = itextsharp.text.image.getinstance(image.tobytearray(magickformat.png)); } javascript function is: apridialogcaricamento(); var datiinput = {}; datiinput.idtipo = idtipo; datiinput.clearengine = clearengine; datiinput.nomefilesvg = numfile; var jsondata = json.stringify(datiinput); var xhr = new xmlhttprequest(); xhr.onreadystatechange = function () { if (this.readystate == 4 && this.status == 200) { chiudidialogcaricamento(); var url = window.url || window.webkiturl; window.open(url.createobjecturl(this.response)); }

c++ - Double move on same object is copying from left to right? -

i beginner in move operation in c++11, playing it. found not able understand. #include <iostream> using namespace std; class a{ public: a(){cout << "default ctor" << endl;} a(const string& str):_str{str}{cout << "parameter ctor" << endl;} a(a&& obj):_str{std::move(obj._str)}{cout << "move ctor" << endl;} a& operator =(a&& rhs){_str = std::move(rhs._str);cout << "move assignment operation" << endl; return *this;} void print(){cout << _str << endl;} private: string _str; }; int main(){ a("rupesh yadav"); // parameter ctor b(std::move(a)); // move ctor cout << "print a: "; a.print(); // not printing --> correct!! cout << "print b: "; b.print(); // printing --> correct!! b = std::move(a); //

python - pyspark reduce key being a tuple values nested lists -

my problem following: parsing users interactions, each time interaction detected emit ((user1,user2),((date1,0),(0,1))). zero's here direction of interaction. i cannot figure out why cannot reduce output following reduce function: def myfunc2(x1,x2): return (min(x1[0][0],x2[0][0]),max(x1[0][0],x2[0][0]),min(x1[0][1],x2[0][1]),max(x1[0][1],x2[0][1]),x1[1][0]+x2[1][0],x1[1][1]+x2[1][1]) the output of mapper (flatmap(myfunc)) correct: ((7401899, 5678002), ((1403185440.0, 0), (1, 0))) ((82628194, 22251869), ((0, 1403185452.0), (0, 1))) ((2162276, 98056200), ((1403185451.0, 0), (1, 0))) ((0509420, 4827510), ((1403185449.0, 0), (1, 0))) ((7974923, 9235930), ((1403185450.0, 0), (1, 0))) ((250259, 6876774), ((0, 1403185450.0), (0, 1))) ((642369, 6876774), ((0, 1403185450.0), (0, 1))) ((82628194, 22251869), ((0, 1403185452.0), (0, 1))) ((2162276, 98056200), ((1403185451.0, 0), (1, 0))) but running lines.flatmap(myfunc) \ .map(l

html - Font Awesome Icon Alignment -

i'm trying home button in header within div aligning under div /header. i have code: .home-button { background: #333; width: 59px; height: 60px; float: right; line-height: 180px; text-align: center; vertical-align: bottom; } div.home-button i.fa { display: inline-block; } <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.2/css/font-awesome.min.css"> <div class="home-button"> <i class="fa fa-home" aria-hidden="true"></i> </div> but displaying icon below div ... any advice? you need change line-height 60px ( same value has height ) if want vertically aligned don't need set other rules i , because font-awesome.css already handles that .home-button { background: #333; width: 59px; height: 60px; line-height:60px; float:right; text-align: center; vertical-align: bottom; } <lin

javascript - Detect when a DIV's height changes without polling or mutation observers -

i need height of div , notified when height changes according data. i using getboundingclientrect() height currently, don't notified of further changes. i tried domattrmodified , mutationobserver detect changes in data, both of them not universally supported in browsers. what's best way notifications changes element's height? the idea (that seems originate blog post on backalleycoder.com ) can use onresize on element in ie <=10. scroll events on specially crafted <div> appended child of element in other browsers or onresize on <object style="position: absolute; top: 0; left: 0; height: 100%; width: 100%;"> appended child of element. there's number of libraries implement or of these approaches: sdecima/javascript-detect-element-resize - uses onresize in ie + scroll in other browsers. small (5kb unminified), not actively maintained atm. wnr/element-resize-detector : uses same idea, more actively maintain

android - i want to move an dialog of an external app to top of the tablet -

another app pop dialog in center of tablet , make app not visible. there way can send kind of api (like in windows ) move (and resize) edges of tablet not close it? , possible close also? thanks since using application , suddenly, gets popup on top of being called different application. basically, there no way application can interrupt until there permissions provided concerned application. however, can check logs , accordingly can write piece of code dismiss popup appears on screen, resizing popup, not sure how handle ui. thanks!

c++ - not printing 5 letter long unicode -

strcpy(t, u8"\u1d004"); print("%s", t) this printing a4, taking 1d00 symbol of a. want print 1 @ https://en.wikipedia.org/wiki/byzantine_musical_symbols thanks, read the documentation ! \unnnn universal character name (arbitrary unicode value); code point u+nnnn may result in several characters ------------------------------------------------------------------------ \unnnnnnnn universal character name (arbitrary unicode value); code point u+n may result in several characters so: strcpy(t, u8"\u0001d004"); // ^^^^^

How to open quick create form to edit a record Dynamics CRM? -

gi have subgrid in main form of entity a, when click in record in subgrid, takes know record in page of sugbrid. want display quick create form information of record can edit form have subgrid. possible in creation mode want edition. there way in dynamics crm? in advance, i sorry asking there no way update record quick create form supported way.

kvm - install proxmox from usb device error -

i try install proxmox using usb, , when click install, see next error: testing cdrom /dev/sr0 umount: can't umount /mnt: invalid argument testing again in 5 seconds finally: no cdrom found - unable continue (type exit or ctrl-d reboot) i prepare usb using imageusb in windows, , have previous fail, try prepare in ubuntu using "dd if=pve-cd.iso of=/dev/xyz bs=1m", don't know problem.

c# - How to know if every queries executed successfully in loop? -

suppose have executed update query in loop using petapoco like, foreach (var obj in mainobject) { db.execute("update table set column = @0 c1=@1 , c2 =@2", column1, obj.data1, obj.data2); } how know if each of these queries has been executed ? usually petapoco returns 1 or greater if single query executed or means if rows affected , 0 if failed. with scenario can trace values adding in loop, like: list<int> checksuccess = new list<int>(); //to trace value returned execute query foreach (var obj in mainobject) { int updated = db.execute("update table set column = @0 c1=@1 , c2 =@2", column1, obj.data1, obj.data2); checksuccess.add(updated); } if (checksuccess.all(i => >= 1)) { //your every queries has been updated }

Neo4j 3.0 - Unable to fetch data from older version (2.3.2) database -

my older database version 2.3.2. there created database , inserted nodes , relationships. now, upgraded 3.0 version , restarted neo4j server. changed the dbms.active_directory = xyz_path but unable fetch data db now. is there more configurations or specific changes need access database. edited error while using migrating config files: [root@enteras02 tools]# java -jar config-migrator.jar path/to/neo4j2.3 path/to/neo4j3.0 exception in thread "main" java.lang.unsupportedclassversionerror: org/neo4j/config/configmigrator : unsupported major.minor version 52.0 @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(classloader.java:803) @ java.security.secureclassloader.defineclass(secureclassloader.java:142) @ java.net.urlclassloader.defineclass(urlclassloader.java:449) @ java.net.urlclassloader.access$100(urlclassloader.java:71) @ java.net.urlclassloader$1.run(url

Spring Cloud Exit Codes & docker restart -

i've application uses config server within docker: https://github.com/kramkroc/eurekafirstdiscovery i want switch docker restart policy always on-failure in order add cap on amount of restart app does. on-failure restart docker container non-zero exit code returned. when application starting, config-server not have started, , application shut down. 0 exit code. there way modify return non-zero exit code? turns out there issue when run spring boot apps java -jar introduced in 1.3.2 reported here: https://github.com/spring-projects/spring-boot/issues/5922 this fixed in 1.3.6 , working in 1.4.0.m2

Is there anything in C# that can be used as database Trigger -

i have erp database "a" has read permission, cant create trigger on table. made erp system (unknown program me ). have database "b" private application application work on both databases. want reflect a's changes(for insert/update/delete) instantly b. there functionality in c# can work trigger works in database??? you have few solutions, best 1 depends on kind of database have support. generic solution, changes in database aren't allowed if can't change master database , must work every kind of database have 1 option: polling . you shouldn't check (so forget more or less instantly) save network traffic , it's better in in different ways insert/update/delete. can depends on how database structured, example: insert : catch insert may check highest row id (assuming need monitor has integer column used key). update : updates may check timestamp column (if it's present). delete : may more tricky detect, first check count n

android - Fragment UI not getting displayed -

activity layout : activity_text_entry.xml <?xml version="1.0" encoding="utf-8" ?> <framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent" android:id="@+id/fragmentcontainer_textentry" /> fragment layout : fragment_text_entry.xml <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <edittext android:id="@+id/text_entry_date" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/choose_date_text" android:layo

php - Convert SQL satement to Zend Db_Table_Abstract_Select code -

i'm trying fetch latest row each customer table below. ---------------------------------------------------------------------------------- | id | customer_id | type | type_id | notes | timestamp | uid | ---------------------------------------------------------------------------------- | 1 | 1 | sales | 9 | note 1... | 1432781613 | 9 | | 2 | 2 | sales | 9 | note 1... | 1432791204 | 9 | | 3 | 3 | sales | 9 | note 1... | 1432881619 | 9 | | 4 | 1 | sales | 9 | note 2... | 1442771601 | 9 | | 5 | 1 | sales | 9 | note 3... | 1462781617 | 9 | i have following code , sql statement works... $type="sales"; $sql = " select cl1.* {$this->_name} cl1 inner join ( select customer_id, max(timestamp) lasttimestamp {$this->_name}

Closest Selector jQuery -

i'm trying select value jquery closest i'm newbie , attempts haven't been successful. can tell me i'm doing wrong ? appreciated! <div class="two columns"> <form class="float-right"> <input type="hidden" id="show_id" value="329"> <input type="hidden" id="user_id" value="172"> <div id="follow-button" class="button small follow-call follow-show float-right">follow</div> </form> </div> <div class="two columns"> <form class="float-right"> <input type="hidden" id="show_id" value="389"> <input type="hidden" id="user_id" value="172"> <div id="follow-button" class="button small follow-call follow-show float-right"

searching a value in 2 columns jquery datatables -

i have been trying search value between 2 columns using code timelapse_table.columns([3,4]).every -> = $("#camera-name").on "keyup change", -> that.search( @value ).draw() but search column 3 not 4. want make if value abc either in column 3 or column 4 should show results. $("#camera-name") input search. , timelapse_table = $("#timelapse_datatables").datatable appreciated thanks

Rendering mobile simulated view inside image of mobile phone on desktop browser -

i relatively new so, , first question hope format & question information correct. looking plugin or tool can assist me specific display issue. i have mobile application deployed both android , ios devices. have mobile web application renders actual mobile application in mobile device web browser when user browses parts of server end cloud service website on mobile device. far good. however, when user browses these parts of cloud service website on desktop/laptop, web application view - some of stretched , not ideally optimised viewing on mobile devices . client user, on desktop/laptop browser can see mobile 'simulated' view of web application. it has happen when user navigates page, not through installing chrome plugins etc i see ideal solution being i mage of generic mobile when browsing on desktop, centred on desktop screen, inside of web app view rendered. there plugin/tool out there this, have done quite bit of research , can find information on emulators t

angularjs - What is the correct way to add a property of specific items from a different array to an object -

i have 2 different arrays, 1 holds categories whilst other holds pages . categories array: $scope.categories = [{ id: 1, name: "test category" }]; pages array: $scope.pages = [{ id: 1, name: "test page", category: 1 }]; i add associated pages category. can achieved knowing if category property page equal category's id . at moment, wrote function loops through function getpagesbyid(categoryid) { var tmp = []; (var = $scope.pages.length - 1; >= 0; i--) { if($scope.pages[i].category == categoryid) { tmp.push($scope.pages[i]); } }; return tmp; } function mergepages() { var tmp = $scope.categories; (var = tmp.length - 1; >= 0; i--) { tmp[i].pages = getpagesbyid(tmp[i].id); }; return tmp; } $scope.categories = mergepages(); is correct angular way achieve this? there no right or wrong answer this. if interpret question 'can angular simplify this?' yes, can. you can use

javascript - Datatables - Change with JQuery -

im setting big data table. need following todo. i've got php var $rowname. im doing kinda php stuff on here , build datatable. need change datatable entrys javascript or jquery. herefore use find or contains method in combination $rowname. there ways ? so, i've got datatable different rows , columns. 1 named domain. want stuff , change color of domainname red. my idea this: $('document:contains(". <?php $rowname ?> . ")').css('background-color', 'red'); so need find element matching $rowname , change css or better change text of it. greats, traxstar

matlab - white space in cell array -

i using textscan read text file , <55x1 cell> examples: 'aa aa' 'a aaaa a' 'a = aaaaa' 'aaaaaa' ' a aaa' 'aa' 'aaa' 'aaaa' . . . . i want delete white spaces in each sting if have sting string = 'i 24 years old' and use string(ismember(string,' ')) = []; it eliminate spaces , 'iam24yearsold' but cell doesn't work or don't know how how can that? suggestions please? you can use strrep : a = { 'aa aa' 'a aaaa a' 'a = aaaaa' 'aaaaaa' ' a aaa' 'aa' 'aaa' 'aaaa' 'i 24 years old'}; strrep(a, ' ', '') this results in ans = 'aaaaa' 'aaaaaa' 'a=aaaaa' 'aaaaaa' 'aaaaaa' 'aa' 'aaa' 'aaaa' 'iam24yearsold'