Posts

Showing posts from 2013

asp.net mvc - MVC4 Registering a user with extra details -

i beginer in mvc. want that, user wil have location. want keep locations in seprate table. the models came are: location model: public class location { [key] [databasegeneratedattribute(databasegeneratedoption.identity)] public int locationid { get; set; } public string address { get; set; } public string city { get; set; } public string state { get; set; } public string postalcode { get; set; } } userprofile model: public class userprofile { [key] [databasegeneratedattribute(databasegeneratedoption.identity)] public int userid { get; set; } public string username { get; set; } public string name { get; set; } public virtual location location { get; set; } } register model: public class registermodel { //attributes username , password , confirmpassword public string name { get; set; } public virtual location location { get; set; } } register controller : public actionresult register(registermodel mo...

c++ - Cereal - multiple de-serialization -

i new cereal, , have (possible simple) question: is there way deserialize multiple objects when don't know number of objects inside (xml) archive? i tried like: std::ifstream is("c:\\data.xml"); cereal::xmlinputarchive archive(is); while (is.good() && !is.eof()) { try{ objectin oin; archive(oin); objectlist.push_back(oin); } catch (exception e){ } } let's have 3 objects in xml file , xml receive hasn't containing object number. so, in code, first 3 iteration ok, 4th generates "unhandled exception @ 0x0035395e in cerealtest.exe: 0xc0000005: access violation reading location 0x00000018." do have suggestion? let me ask question before trying answer question: if serializing unknown number of items, why not place items in container designed hold variable number of items? use std::vector store objectin , handle number of them. code like: std::vector<myobjects> v...

javascript - FullCalendar Not Rendering in Tabs -

i have basic custom tabs setup function using click events show/hide divs. fullcalendar isn't showing on 1 of tabs despite using render function ( docs ). $(".tabs .tab").click (e) -> ... $("#calendar").fullcalendar "render" the #calendar div hidden, understanding, render function should force calendar render each click. of other tabs work properly, know it's not problem show/hide functionality @ all. does know might going wrong here? the problem ended being related way showing/hiding divs- the css selector using hide divs broad , ended assigning display: none; calendar div (which child of tab content divs). the solution change: $("#tab-contents div").hide() to: $("#tab-contents").children().hide in html calendar shown (in haml): #tab-contents #tab-calendar #calendar #tab-other ... thanks , suggestions, , should have posted more code in beginning.

php - connection to google cloudsql -

im trying connect google cloudsql appengine, im facing error: no connection made because target machine actively refused my php file, have uploaded appengine: $sql = new mysqli(null, 'myuser', // username 'mypass' 'mydb', null, '/cloudsql/**:**' ); if ($mysqli->connect_error) { echo 'no'; die('connect error (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error); } else { echo 'yes\n'; } the appengine allowed cloud sql. should ? i have been trying replicate error getting unable reproduce when using code sample provided. also code sample has few mistakes, create connection $sql check $mysqli connection errors, should checking $sql. have changed occurances of $mysqli $sql , more conventional way check connection error check connect_errno , read message connect_error $sql = new mysqli(null, 'your-username', // username 'your_password_or_blank_if_using_roo...

python - How do I properly link against OpenGL framework using clang in OS X and Xcode 5.1? -

i trying figure out building bug in older python project, , stumped. project requires library linked against opengl , , setup.py passing -framework opengl flag linking stage of clang. system running 10.9.2 , xcode 5.1. include line in c file is: #include <opengl/glu.h> the call clang , resulting error is: /usr/bin/clang -bundle -undefined dynamic_lookup -l/opt/local/lib -wl,-headerpad_max_install_names -l/opt/local/lib/db46 build/temp.macosx-10.9-x86_64-2.7/src/visual/_polyobject.o -o build/lib.macosx-10.9-x86_64-2.7/trep/visual/_polyobject.so -framework opengl clang: error: unknown argument: '-framework opengl' [-wunused-command-line-argument-hard-error-in-future] clang: note: hard error (cannot downgraded warning) in future error: command '/usr/bin/clang' failed exit status 1 now comes weird part. exact same call clang, done shell script runs fine , links library correctly, no errors or warnings. running clang --help of no help, not describe -fr...

.htaccess - htaccess block users but not bots -

i have wordpress installation in subfolder , used api spa. block users seeing wordpress pages, allow bots crawl them (angularjs app using _escaped_fragment_ serve static content). if user hits /wordpress/ redirect root what htaccess rules this? (doesn't work): rewritecond %{request_uri} ^/wordpress[/]$ rewritecond %{http_user_agent} !=(googlebot|bingbot|baiduspider) [nc] rewriterule ^(.*)$ / [r=301,l]

xml - XSLT Date Formatting -

i have had @ various suggestions on here none problem. due sources xml comes can receive dates in following 3 formats; 04-04-2014(dd-mm-yyyy) 04-apr-2014(dd-mmm-yyyy) 2014-04-04(yyyy-mm-dd) i have function or simple command change of these (other third, yet able recognize third correct) yyyy-mm-dd i have long winded when/when/when currently, there must easier way. current xslt following; <xsl:choose> <xsl:when test="contains(date, 'jan')"> <xsl:value-of select="concat(substring(date,6),'-01-',substring(date,1,2))" /> </xsl:when> <xsl:when test="contains(date, 'feb')"> <xsl:value-of select="concat(substring(date,6),'-02-',substring(date,1,2))" /> </xsl:when> <xsl:when test="contains(date, 'mar')"> <xsl:value-of select="concat(substring(date,6),'-03-',substring(date,1,2))" /...

ios - CGAffineTransform - Compensate for an upper left transform rotate -

i need apply translation transformation compensate rectangular view being rotated around (0,0), original origin of view 0,0. the end result should make appear view transformed around center point. cgaffinetransform newtransform = cgaffinetransformidentity; newtransform = cgaffinetransformrotate(newtransform, angle); newtransform = cgaffinetransformtranslate(newtransform,?,?);

How to override Contextual Action Bar when selecting text in a WebView in Android? -

i've googled lot, , find tutorials , answers here in stackoverflow, facing difficults resolve issue. i have fragment webview, , want show custom contextual action bar when user selects text of web view. have 2 main issues here: 1 currently, custom cab showed when user performs long click in part of web view. 2 text not selected when user performs long click in text of web view. some of current code: custom interface: public class selectactionmodecallback implements actionmode.callback { @override public boolean oncreateactionmode(actionmode mode, menu menu) { return false; } @override public boolean onprepareactionmode(actionmode mode, menu menu) { return false; } @override public boolean onactionitemclicked(actionmode mode, menuitem item) { return false; } @override public void ondestroyactionmode(actionmode mode) { } } custom webview public class customwebview extends webview { p...

c - Segmentation fault: 11 Server/Client -

enum recstate { initial }; int num_clients = 0; static void addclient(int fd, struct in_addr addr){ struct client *p = (struct client *) malloc (sizeof(struct client)); if (!p) { fprintf(stderr, "out of memory!\n"); exit(1); } printf("adding client %s\n", inet_ntoa(addr)); p->fd = fd; p->next = top; p->state = initial; top = p; num_clients++; } struct client { int fd; // socket descriptor client enum recstate state; // current state of data transfer client struct client *next; // pointer next client in list struct in_addr ipaddr; } *top = null; int main(int argc, char* argv[]){ int listenfd, clientfd, maxfd, nready; struct client *p; struct sockaddr_in self, client; listenfd = socket(af_inet, sock_stream, 0); memset(&self, '\0', sizeof(self)); self.sin_family = af_inet; self.sin_add...

c++ - Optimize this function? -

i have written code (uses v8 library). went through couple of times , feels it's way can write this. aim of function replace javascript .split() function; when using function limit doesn't include last part of array in returning array. eg: var str = "test split string limit"; var out = str.split(' ', 2); the array out contain: [ test , split ]. want contain: [ test , split , string limit ]. i know there pure js ways find them hacky , possibly slower(?) single c++ bind call. here's function: /** * explodes string limits tokens * @param input * @param delim * @param limit * @return */ void asengine::engine::asstrtok(const v8::functioncallbackinfo<v8::value>& args) { assert(3, args); isolate* isolate = args.getisolate(); /* args */ string::utf8value a1(args[0]); string::utf8value a2(args[1]); local<uint32> a3 = args[2]->touint32(); std::string input = std::string(*a1); std::string de...

class - java.lang.ClassNotFoundException: -

i trying work php-javabridge. i want access java class on centos tomcat7. here's php code: require_once("/var/lib/tomcat7/webapps/javabridge/java/java.inc"); try { $spi= new java("ae.co.comtrust.payment.ipg.spij.transaction"); echo $spi; } catch (javaexception $ex) { echo "an exception occured in first block: "; echo "<br>\n"; echo $ex; echo "<br>\n"; } when run http://example.com/test.php , getting following error. [[o:exception]:"java.lang.exception: createinstance failed: new ae.co.comtrust.payment.ipg.spij.transaction. cause: java.lang.classnotfoundexception: ae.co.comtrust.payment.ipg.spij.transaction vm: 1.7.0_51@http://java.oracle.com/" at: #-32 org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1714) #-31 org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1559) #-30 java.lang.class.forname0(native method) #-29 java.lang...

javascript - dc.js: Tooltip does not display -

i'm making graph using dimensional charting javascript library dc.js, based on d3 , crossfilter. new in dc.js library.i trying display graph using django framework python.i trying display styling tooltip cant display.i trying following code. {% extends "base.html" %} {% load staticfiles %} {% block content %} <head> <link href="{% static 'css/dc.css' %}" rel="stylesheet" media="screen"> </head> <body> <div class="container" style="margin-top: 140px"> <div class="col-lg-4" id="test"> </div> <div class="col-lg-4" id="test1"> </div> <script type="text/javascript" src="{% static 'js/d3.js' %}"></script> <script type="text/javascript" src="{% static 'js/cr...

why Postgresql COPY command not working using c? -

i trying load data stored in .csv file postgres database using c on ubuntu. using 'copy' command load data as, conn = pqconnectdb("dbname=ravidb host=localhost user=ravi password=pwd"); char *loaddata ="copy loadcsv 'my_path/test.txt' delimiter ',' csv;"; pqexec(conn, loaddata); before executing above command have created empty table 'loadcsv', required file not getting copied database. stuck here. have same???

c - Left shift of negative values by 0 positions? -

in c, left shift of negative value undefined behavior. i've encountered 2 libraries compiled intel's icc offending code removed. same code fine under clang, comeau, gcc , msvc. does standard make mention of left shifting negative value 0 places? undefined? (the detail i'm curious 0-sized shift, no shift @ in practice. i'm wondering if language vague such 0-sized left shift may allowed). excerpt c99 technical corrigenda tc1, tc2, , tc3 included : 6.5.7 bitwise shift operators [...] the integer promotions performed on each of operands. type of result of promoted left operand. if value of right operand negative or greater or equal width of promoted left operand, behavior undefined. result of e1 << e2 e1 left-shifted e2 bit positions; vacated bits filled zeros. if e1 has unsigned type, value of result e1 × 2 e2 , reduced modulo 1 more maximum value representable in result type. if e1 has signed type , nonnegative value, , e1 ...

excel - VBA - "Wrong number of arguments or invalid property assignment" - Cells() -

following tutorial arrays on vba excel. can see, commented out , still error. if use range("a1", "a1").value = 1 there's no problem. noticed intelisense doesn't pick 'cells(' option explicit sub arraytest() 'dim arrayint(1 5) integer 'dim integer 'dim j integer ' j = 1 ubound(arrayint) ' arrayint(j) = 10 * j ' next j ' = ubound(arrayint) cells(1, 1).value = 1 'arrayint(i) ' next end sub try using application , check if intellisense picks cells property. if so, replace code this: application.cells(1, 1).value = 1

sql - Extract numbers in a body of text in mysql -

suppose have column has text numbers. example, row 1: have 3 apples. row 2: in y2009, bill 32 dollars. row 3: 22 years old. i want create column follows: row 1: 3 row 2: 32 row 3: 22 note not want accidentally extract 2009 y2009. want 32. tried following, extracts rows numbers come first. select @num := convert(`col1`, signed) num_part my_table;

Got "ipc.HBaseRPC: Pro blem connecting to server" when I use java api to connect to Hbase -

import java.io.ioexception; import org.apache.hadoop.conf.configuration; import org.apache.hadoop.hbase.hbaseconfiguration; import org.apache.hadoop.hbase.client.get; import org.apache.hadoop.hbase.client.htable; import org.apache.hadoop.hbase.client.put; import org.apache.hadoop.hbase.client.result; import org.apache.hadoop.hbase.client.resultscanner; import org.apache.hadoop.hbase.client.scan; import org.apache.hadoop.hbase.util.bytes; public class mylittlehbaseclient { public static void main(string[] args) throws ioexception { configuration config = hbaseconfiguration.create(); config.addresource("/users/apple/documents/tools/hbase-0.94.17/conf/hbase-site.xml"); htable table = new htable(config, "mylittlehbasetable"); put p = new put(bytes.tobytes("mylittlerow")); p.add(bytes.tobytes("mylittlefamily"), bytes.tobytes("somequalifier"), bytes.tobytes("some value")); table.put(p); ...

how to read or display the txt file from the bottom in php -

i want display txt file contents bottom display oldest posts. $file = file("./files/data.txt"); for($i =0;$i<count($file);$i++){ print nl2br($file[$i]); } this simple code display text contents top bottom,but want contents displayed bottom top. glad if can me out. change $file = file("./files/data.txt"); to $file = array_reverse(file("./files/data.txt")); //<----- reverse array using array_reverse no need modifications on loop , if above change. source

android - Set SearchView searchSuggestThreshold programmatically -

i creating searchview .java class not xml file , trying set min character length trigger search functionality. found out can xml file following: <searchable xmlns:android="http://schemas.android.com/apk/res/ ... android:searchsuggestthreshold="3" ... /> but, i want know how programmatically

android - Location Updates through a serivce -

i trying location updates in background when app gets closed. im trying through service. working fine when app open, when close service seems closed. thats code im using: mainactivity: public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); intent intent = new intent(this, myservice.class); startservice(intent); } myservice: public class myservice extends service { public static final string broadcast_action = "hello world"; private static final int two_minutes = 1000 * 60 * 2; public locationmanager locationmanager; public mylocationlistener listener; public location previousbestlocation = null; private string provider; @override public void oncreate() { super.oncreate(); intent = new intent(broadcast_action); } @override public void onstart(intent intent, int startid) { locationmanager = (locationmanag...

Sending mail using PHP (to the one that puts the email in the EMAIL INPUT) -

i want know how can , (for exemple friend ) sends email himself using php mail() function ive created.i give him website ,he puts email , message ( inside form ive created) pressing submit button, im 1 getting email not him.im new programing.ty use this $email = "youremailaddress"; $yoursubject="something ..."; $yourmessage="something else..."; mail($email, $yoursubject, $yourmessage);

php - Can't display image because it contains errors -

i have been trying display image in php last 3 hours. followed few threads on how achieve , pass 2 hours on stackoverflow , other forum try fix problem. the following code trim down of 1 use. (i have more code handle jpeg, png , different sql tables) mysql settings i have table called teams in have these 3 values : id , image , mime current php code i have file called show_image.php pass id right image. if(isset ($_get['id'])) { $id = $mysqli->real_escape_string($_get['id']); $query = 'select `image` `teams` `id` = ?'; if ($stmt = $mysqli->prepare($query)) { $stmt->bind_param('i', $id); $stmt->execute(); $stmt->store_result(); if ($stmt->num_rows == 1) { $stmt->bind_result($image); $stmt->fetch(); header('content-type: image/jpeg'); // can use db query change type needed echo $image; } } } and say...

three.js - three js apply texture -

Image
i'm unable apply image texture object exported 3d studio max. can see in image, texture loaded applied once in center of face. i've tried repeat texture with texture.wraps = texture.wrapt = three.repeatwrapping; texture.repeat.x = 2; texture.repeat.y = 2; but it's worst. see code below <html> <head> <meta charset="utf8"> <title>demo customizer</title> <script src="lib/three.min.js"></script> <script src="lib/controls/trackballcontrols.js"></script> <script src="lib/controls/orbitcontrols.js"></script> <script src="lib/loaders/mtlloader.js"></script> <script src="lib/loaders/objmtlloader.js"></script> <script src="lib/loaders/objloader.js"></script> <script src="lib/detector.js"></script> <script src="lib/libs/stats.min....

cmake - How to add path before every cpp in a SET variable? (CMakeLists) -

i have following variable in cmakelists: set(source s1.cpp s2.cpp ... ) i add path before each sx.cpp don't want add hand that: set(path path) set(source {$path}s1.cpp {$path}s2.cpp ... ) is there way add path without having copy variable around? thanks foreach(src ${source}) list(append src2 "${path}/${src}") endforeach() and have result in src2

imageview - Picture Preview page in coldfusion -

i know how upload image file server , show image file page. but if want preview on confirmation page? i can generate temp file isn't saved in database file in physical location, if decided hit "no" button. how temp file deleted? the code below shrinks image , shows on page. creates image within directory, stay there after hit ok or no. no button , while ok naturally submit . <!--- make temp image preview ---> <cfset mediapath = expandpath('../images/about')> <cfif structkeyexists(form,"image") , len(form.image)> <cffile action="upload" filefield="image" destination="#mediapath#" nameconflict="makeunique"> <cfimage name="uploadedimage" source="#mediapath#/#file.serverfile#" > <cfset imagesize = 320> <cfif uploadedimage.width gt uploadedimage.height> <cfset p...

Strategy for generating unique identifier for document in RavenDB -

say have support ticket system (simplified example). has many users , organizations. each user can member of several organizations, typical case 1 org => many users, , of them belong organization. each organization has "tag" used construct "ticket numbers" organization. lets have org called stackexchange wants tag ses. so if open first ticket of today, want ses140407-01 . next ses140407-02 , on. doesn't have 2 digits after dash. how can make sure generated in way makes sure 100% unique across organization (no orgs have same tag)? note: not have document id in database - guid or similar. ticket reference - kinda slug - appear in related emails etc. has unique, , prefer if didn't "waste" sequential case numbers hilo style. is there practical way ensure unique ticket number if 2 or more people report new 1 @ same time? edit : each organization document in ravendb , , can hold property lastissuedticketid . challenge find best way read...

jquery - Create javascript object from doubleqoute text -

i have messy problem i'm stuck with. try use mvc model in javascript object (for later knockout binding). what i'm in controller (object simplified showing problem): public actionresult projectserviceoverview() { var result = new { text = "hello ""test"" test.." } return view(result); } and in client code (aka java script): $(function () { var jsonmodel = '@html.raw(newtonsoft.json.jsonconvert.serializeobject(this.model))'; var mvcmodel = json.parse(jsonmodel); [...] my problem @ runtime server side generated json (var jsonmodel) looks , invalid because of double quots. { "reason": "hello "test" test..." } i try find solution work without doing nasty replace ( " \") operation. there smarter way? in working code objects comes database mapped entity framework. update 1 ok found out 'html.raw...

datetime - Date conversions in JavaScript -

i have text field date read so: var varstartdate = new date($("#txtfromdate").val()); the value in varstartdate comes in mm/dd/yyyy so: 4/7/2014 is there way convert yyyy/mm/dd comes in so: 2014/4/7 any appreciated. regards. you can split string , pass parts new date var datearr = $("#txtfromdate").val().split('/'); var startdate = new date(datearr[2], datearr[0], datearr[1]); or put them again string var startdate = datearr[2] + '/' + datearr[0] + '/' + datearr[1];

How To Get Status Update Posted By Page - Facebook Graph API -

creating desktop application in needs grab post_id of status updates posted page (no photos, videos , other stories/types.) i'm using type parameter task easily. https://graph.facebook.com/{username or id of page}/posts?fields=object_id,type&limit=250&access_token={my access token} the giving url returning list of posts it's types , post id my page updated status { "type": "status", "id": "493341197400693_627621933972618", "created_time": "2014-04-05t18:31:58+0000" }, it's working fine problem post in list type=status not status update it's story i.e "my page commented on photo" my page commented on photo { "type": "status", "id": "493341197400693_626576670743811", "created_time": "2014-04-03t11:27:22+0000" }, how confirm either status update or story if type of both response "status" . want igno...

sorting - Sort in R with multiple criteria (alphanumeric) -

l <- c("bc321" , "bc320", "bc100" , "da124" ,"da174" ,"da224", "da33", "da98" ) require('gtools') mixedsort(l) "bc100" "bc320" "bc321" "da33" "da98" "da124" "da174" "da224" but want "da33" "da98" "da124" "da174" "da224" "bc100" "bc320" "bc321" really appreciate help. thank you here's 1 way: x <- strsplit(l, "(?<=[a-z])(?=[0-9])", perl=true) ## v1 = sapply(x, `[[`, 1l) v2 = as.integer(sapply(x, `[[`, 2l)) l[order(-xtfrm(v1), v2)] # [1] "da33" "da98" "da124" "da174" "da224" "bc100" "bc320" "bc321" check this post josh o'brien magic happening strsplit (marked ##).

Spring same dataSource for different JdbcTemplates -

i have different dao's have same class require different jdbctemplates use same type of datasources. there way consolidate code, don't need use copy , paste. an example of have in xml is: <bean id="jdbctemplate1" class="org.springframework.jdbc.core.jdbctemplate"> <property name="datasource" ref="jdbcdatasource1" /> </bean> <bean id="jdbcdatasource1" class="com.zaxxer.hikari.hikaridatasource" destroy-method="shutdown"> <constructor-arg> <bean class="com.zaxxer.hikari.hikariconfig"> <constructor-arg> <props> <prop key="datasource.url">datasourceurl </prop> <prop key="datasource.user">user</prop> <prop key="datasource.password">password</prop> ...

php - How can I query raw via Eloquent? -

i trying query in laravel app , want use normal structure query. class either use eloquent need find query totally raw. might model::query($query); . doesn't work. use db::statement('your raw query here') . hope helps.

Geoshow function matlab error -

i trying use geoshow in matlab plot lat lon coordinate, example geoshow(-75.30355274,-87.96741337) undefined function 'geoshow' input arguments of type 'double'. i have tried using geoshow([-75.30355274],[-87.96741337]) still error. know how can resolve this? this problem path of function file. one easy way verify open function in editor , try execute it. make editor try run file, , in case file not in path, prompt message box. choose add path in that, , must fine go. also mentioned in 1 of comment question please verify if mapping toolbox installed or not.....

javascript - Adding you tube player (iFrame) in jQuery modal dialog -

i have images in html , _i need play embedded tube video videos on click of each image should load/play in jquery ui dialog . pop video player. so here have done play/attach video each image. have 3 images , have added unique video id in custom data-attribute taken tube. html <div id="imagebox"> <img src="img1.png" class="playvideo" alt="" id="image1" data-videoid="v6jg8g"/> <img src="img2.png" class="playvideo" alt="" id="image2" data-videoid="re84hj"/> <img src="img3.png" class="playvideo" alt="" id="image3" data-videoid="dhj3fk"/> </div> <!-- html jquery modal dialog --> <div id="myvideoplayer"> <div> <strong id="videotitle">title video</strong> <img src="closebutton.png" id="close" alt=...

servlets - Unable to get user agent fron Android httpclient -

i using httpclient send request android app web server , trying take user-agent in servlet. getting 'apache-httpclient/unavailable (java 1.4)'. how know request android app? kindly suggest resolve this? use code android default user agent. httpclient.getparams().setparameter(coreprotocolpnames.user_agent,system.getproperty("http.agent"));

sql - Select same values from different schema dynamically based on a common table -

i have database consisting of mutiple schemas same structure. enables segregate data based on enterprise. there mutiple schemas db_client1, db_client2 etc. , common properties defined in public schema. there 1 such common table definition below: create table enterprises( ent_id bigint, schema_name character varying ) there requirement pick similar information tables schemas. each entry in table enterprises need select information corresponding schema_name. query fired each enterprise select v1.no, v1.surrogate_id, v2.startdate, v2.enddate table1 v1 inner join table2 v2 on v2.surrogate_id = v1.surrogate_id we require schema_name appended each table in above query table enterprises. how can data enterprises without using cursor. sample output looking ent_id no surrogate_id startdate enddate 100001 1001 2001 2014-03-01 2014-03-05 100001 1002 2002 2014-03-01 2014-03-05 100001...

Portfolio Wordpress -

i'm using wordpress website cms. use pages, , not posts. i'm looking wordpress portfolio allows me following thing : i filter portfolio multiple terms, example : colors (category) - red (choice - blue - black topic - car - bus - truck making 2 choices, plugin display 'red' 'cars" 1 example me : http://www.ldlc.com/image-son/television/support-mural/c4399/ here closest plugin i've found : http://wordpress.org/plugins/awesome-filterable-portfolio/developers/ 1 works perfectly, can't cross 2 or more terms reduce results funnel. option : can use posts instead of simples images if easier parse, looking display ... thanks idea it better use custom post type , taxonomy manage requirement. there plugin works similar requirement. nimble portfolio plugin have features. see demo here

The Natural Join of Mysql -

i'm little confused natural join in mysql. suppose that: there 2 tables table1 has columns: id, name, address, number (id pk of table1) table2 has columns: id, name, number, money (id pk of table2) i have make "id" of table1 foreign key, referencing "id" of table2 and suppose "number" in table1 "people's number" , "number" in table2 "telephone number" 2 columns have different meaning same name when natural join of table1 , table2 : does mysql check columns of table1 , table2 , name same, means tuple(row) selected ,if , if, "id" , "name" , "number " must same (for example, "id" , "name" same "number" different, row not selected)? or does mysql check foreign keys created, means row selected , if , if, "id" same? another question is: after natural join of table1 , table2 , there 1 column called "id...

delphi - Remove empty strings from TStringList -

is there build-in function in delphi remove strings tstringlist empty? how loop through list remove these items? to answer first question, there no built in function that. looping manually easy. should it: for := mylist.count - 1 downto 0 begin if trim(mylist[i]) = '' mylist.delete(i); end; note loop must traverse list in reverse starting count-1 down 0 work. the use of trim() optional, depending on whether want remove strings contain whitespace or not. changing if statement if mylist[i] = '' then remove empty strings. here full routine showing code in action: procedure tmyform.button1click(sender: tobject); var i: integer; mylist: tstringlist; begin mylist := tstringlist.create; try // add random stuff string list := 0 100 mylist.add(stringofchar('y', random(10))); // clear out items empty := mylist.count - 1 downto 0 begin if trim(mylist[i]) = '' mylist.delete(i); e...

ElasticSearch update API - add fieldname starting with @ sign -

the es update api can't set new field if name starts @: { "script" : "ctx._source.@timestamp = 20120101000000" } anybody else stumbled upon before? there ctx._source.remove() equivalent adding fieldnames try workaround? you can using ["fieldname"] notation: { "script" : "ctx._source[\"@timestamp\"] = 20120101000000" }' or put method: { "script" : "ctx._source.put(\"@timestamp\", 20120101000001)" }