Posts

Showing posts from June, 2011

java - How to redirect user and pass a message to the destination page with Jersey and Dropwizard? -

i have pojo resource defines http endpoints , returns dropwizard views. of these endpoints perform action (eg. update db) , forward user endpoint. example, user @ location get /foo , submits form. directs them endpoint post /foo/submit , submission processed, , forwards them get /foo/done . prevents resubmission of form if refresh page, example. forwarding accomplished jersey's response.seeother() method (returning response instead of view). what able is, when handling method handles submission, generate sort of message (error message, warning, successful, etc) , pass message page forward to. example, @ get /foo/done , @ top of page, "submission complete!" or "submission failed because...". i've done searching around , lot of people suggesting throw webapplicationexception - except not of cases errors. i'd show confirmation of successful action. can't figure out how receiving method receive message. i've done before in python having hand...

How do I parse this JSON using VB.net? -

so, i'm working on school project, , i'm trying figure out best way deal data file contains pretty large amount of json objects. know basics of vb.net, basic event handling, etc. i know basics of designing structures, , stuff that, need figure out how parse , create list of objects 5mb json file contains entries such following: { "air elemental":{ "layout":"normal", "name":"air elemental", "manacost":"{3}{u}{u}", "cmc":5, "colors":[ "blue" ], "type":"creature — elemental", "types":[ "creature" ], "subtypes":[ "elemental" ], "text":"flying", "power":"4", "toughness":"4", "imagename":...

Python Error unsupported operand type(s) for %: 'NoneType' and 'str' on my code -

so i'm having lot of trouble code... gives me error , don't see nothing wrong it! have 15 days studying python don't see error in code when try run in python shell gives me error: "unsupported operand type(s) %: 'nonetype' , 'str'" please me out t____t i'm frustrated! @classmethod def populationcount(cls): print ("the total number of humans is: %d.") %(cls.population) the reason you're having problem in line: print ("the total number of humans is: %d.") %(cls.population) is print executed first, stuff in first set of parentheses argument. return value of print used % operator. print returns none , python trying do: none % (cls.population) and can figure out why that won't work. to solve it, put entire % operation inside parentheses done before print called. after all, want result of interpolation printed. print("the total number of humans is: %d....

javascript - Zurb Foundation based CMS, preview effect of media queries -

Image
i'm building cms based on zurb foundation, , 1 thing i'd allow user switch between large/medium/small layouts via button can both preview how page looks @ size, can set columns etc. different breakpoints. media queries predicated on window width, , i've been far able build users find quite intuitive, , feel asking them resize browser window change mode seems bit iffy. an immediate way can think of use iframe main edit view, problem page interactions have quite complex, drag & drop, drag resize etc. - have of these working @ present both mouse , touch, , in order drag & drop between parent , iframe i'd have rewrite significant amount of code. i'd rather avoid if @ possible. i'm looking suggestions/advice on how make work - workarounds , hacks fine. this how looks @ moment, give idea of kind of interface have - no live link can share atm, sorry: ok - solution i've come far - whole page, not editor area goes in iframe. https://g...

c# - How to convert a model to it's viewmodel based on model name -

i trying figure out not sure if possible. goal have extension method called converttopersonmodel copies personviewmodel personmodel. possible can change parameters accept viewmodel , convert it's normal model. instance, pass in employeeviewmodel converted employeemodel, or roleviewmodel rolemodel in 1 method. this extension method: public static personmodel converttopersonmodel(this personviewmodel viewmodel) { var model = new product(){ firstname = viewmodel.firstname; lastname = viewmodel.lastname; } return model; } so goal able pass in view model , figure out properties of relevant model (which properties normal model has) , assign values depending on viewmodel/model pair is. may confusing, let me know if need more clarification. somethings like: public static model converttomodel(this viewmodel viewmodel) { var model = new findwhichmodelisrelatestoviewmodel(){ 1stproperty = viewmodel.relevantproperty; 2ndpropert...

javascript - YII: Assign value to a variable from onclick method -

good afternoon i've been struggling these 2 days , i'm running out of time... i have modal... <div class="modal-header"> <a class="close" data-dismiss="modal">&times;</a> <?php if ( $modaltoopen == "1") { ?> <h4>aplicar abono la cuenta #<?php echo $cardinformation->cardnumber ?></h4> <?php } ?> <?php if ($modaltoopen == "2") { ?> <h4>aplicar cargo la cuenta #<?php echo $cardinformation->cardnumber ?></h4> <?php } ?> </div> <div class="modal-body"> <p>saldo actual: <?php echo $lastbalance ?></p> <?php echo $modaltoopen ; if($modaltoopen == 1){ ?> <?php $form = $this->beginwidget('bootstrap.widgets.tbactiveform', array('id' => 'inlineform', 'type' => 'inline', 'htmloptions' =>...

python - Subprocess error file -

i'm using python module subprocess call program , redirect possible std error specific file following command: with open("std.err","w") err: subprocess.call(["exec"],stderr=err) i want "std.err" file created if there errors, using command above if there no errors code create empty file. how can make python create file if it's not empty? i can check after execution if file empty , in case remove it, looking "cleaner" way. you use popen, checking stderr: from subprocess import popen,pipe proc = popen(["exec"], stderr=pipe,stdout=pipe,universal_newlines=true) out, err = proc.communicate() if err: open("std.err","w") f: f.write(err) on side note, if care return code should use check_call , combine namedtemporaryfile : from tempfile import namedtemporaryfile os import stat,remove shutil import move try: namedtemporaryfile(dir=".", delete=false) e...

sql server - How to filter a column using multi value parameter list in SSRS -

i new ssrs. thought should simple took me 1 day , not able fix it. need following select * table1 len(username) <= 6 select * table1 len(username) >= 7 i want display drop menu 2 options short username , long username. when username click short username first query result showed , when user click long username second query result showed. what did far added parameter list 2 values i.e short parameter list = 6 , long parameter list = 7. added 2 filters. in first expression= len(namecolumn.value) operator= <= value = @parameter. in second expression= len(namecolumn.value) operator= >= value = @parameter. can please can achieve it. you can similar filter in dataset @energ1ser mentioned. you have parameter user selects either long or short. might use different values it. for expression, use: =iif( (parameters!yourparameter.value = "short" , len(fields!username.value) <= 6) or (parameters!yourparameter.value = "long" , len(fie...

java - EclipseLink Canonical Metamodel from already compiled entity classes -

i cannot seem figure out how should eclipselink's canonicalmodelprocessor generate metadata classes entities mapped in orm.xml file, , not source files in current compilation unit, instead included in compiler's classpath. i'm trying maven, calling compiler plugin without further options. verify eclipselink annotation processor executes, , finds both persistence.xml , orm.xml, , succeeds in processing both files. fails when internally walks through "roundelement" classes , tries map against defined in persistence unit. obviously, classes classpath not in "roundelements" list, , no code generated them, though metadata present , valid in internal persistenceunit object. does have idea how work? thanks! edit: excerpt of pom.xml: <dependencies> <dependency> <groupid>com.model</groupid> <artifactid>app-model</artifactid> <version>1.0.0</version> </dependency> <dependenc...

c - socket not bind() ing - Invalid argument -

good evening all, kicks , giggles i'm trying hand @ *nix sockets , tcp/ip. now, off ground i'm trying create socket on 2 endpoints , basic text chat program , forth. now, before i'm , running i'm hit bind 'invalid argument': user@user-virtualbox:~/sockets$ ./socket sock=3 s_->sin_family = 2 s_->sin_port = 3879 s_->sin_addr.s_addr = 0 sockfd = 3 s_->sin_family = 2 s_->sin_port = 3879 s_->sin_addr.s_addr = 0 socket bind error: invalid argument sizeof(s_) = 8 code below. so, inaddr_any should 255.255.225.255 = 0, understand; af_inet 2; , sin_port, well, i've looked @ binary backward , forward , not sure understand how 9000 represented in host order @ 3879 9000, assume it's non-issue. additionally, since 1 stdout , 2 stderr, assume above dynamically allocated , 3 should fine socket file descriptor. #include <stdio.h> #include <stdlib.h> #include <sys/socket.h> #include <netinet/in.h> #include <strin...

android: assigning a number to a specific image -

i creating a card game using standard deck of 52 playing cards. want generate random number between 0 , 52 , depending on number, draw assigned card number. how go doing that? ok, let's suppose have activity this: public void oncreate (bundle savedinstancestate){ super.oncreate(savedinstancestate); setcontentview(r.layout.mainlayout); imageview imageview = (imageview) findviewbyid(r.id.mycard); randon ran = new random(); int number = ran.nextint(51); switch(number){ case (0): imageview.setimageresource(r.drawable.card0); case (1): imageview.setimageresource(r.drawable.card1); case (2): imageview.setimageresource(r.drawable.card2); //rest of cases } } now let's suppose have mainlayout.xml file inside res/layout folder looks this: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/ap...

python - Django, javascript, and complex forms -

i'm building app in django lets users create , edit flowcharts purpose of process/procedure control. there 3 basic models: procedure , step , , transition . i've created , debugged model relationships , through admin interface , shell, can create procedures several steps , transitions . it's functional not intended end user. need create browser-based jgraphical interface. enter visjs , javascript visualization library. using visjs, i've created basic block-diagram editor lets users add/edit/delete nodes , edges (this first javascript attempt ever). can load data database , post data database through couple of custom views , json serialization. however, feels kludgey , hard maintain. example, it's not integrated django's forms framework @ all. at moment, when submitted, javascript serialization post json data , json data only. i'd standard form submission can't figure out how structure form. how go building form handle this? i'm trying j...

Elasticsearch regexp on query -

i have following query works great: query: { multi_match: { fields: ["first_name", "last_name", "email", "sku"], query: query, type: "cross_fields", operator: "and" } however, i'd have incoming query rid of non-alphanumeric characters, using regex: [^a-za-z0-9\ @\.] is there way have elasticsearch filter incoming query regex fields? you can specify different analyzer search during query construction. query: { multi_match: { fields: ["first_name", "last_name", "email", "sku"], query: query, type: "cross_fields", operator: "and", analyzer: "your-custom-analyzer" } you have provide definition of "your-custom-analyzer" in mapping. analyzer definition can use pattern replace filter meet requirement.

bash - execute curl and export base64 file to variable -

i'm developing script downloads file, convert base64 , export code variable. @ moment can accomplish in 2 steps (which force me save file). how can directly download , export content without saving fine... i.e. in 1 line? this i'm doing... #!/bin/bash -x curl -o top10.jpg "http://www.somesite.com/top10.jpg" top10=$( base64 top10.jpg) thanks! you can use process substitution : top10=$(base64 <(curl "http://www.somesite.com/top10.jpg")) or, etan reisner points out in comment, pipeline work well: top10=$(curl "http://www.somesite.com/top10.jpg" | base64) while process substitution results in filename getting passed base64 (either name of fifo or named file descriptor such /dev/fd/63 , depending on platform), pipeline passes data base64 via stdin - net effect same here. the advantage of using pipeline is posix-compliant, whereas process substitution bash -specific feature.

postgresql - How to Notify Deadlocks in Postgres -

i new postgres databases. can suggest how notify if there deadlock happening in postgres. how set email alerts deadlocks . thanks in advance... generally, postgres logs deadlock information in log files under /var/lib/pgsql/data/pg_log directory. can create script read log files , grep word 'deadlock' , notify through email. schedule cron job run script in day. of course, limitation may not emails @ moment deadlock occurs, still helpful. thanks

c++ - How do I output an unsigned char* to file without reinterpret_cast -

i have unsigned char* filled characters not ascii example: ` ¤Ýkgòd–ùë$}ôkÿuãšj@Äö5Õne„_–Ċ畧-ö—rs^hÌvÄ¥u` . if reinterpret_cast , i'll lose characters if i'm not mistaken because they're not ascii. i've searched everywhere solutions require sort of casting or conversion alter data. here's have, doesn't work. unsigned char* ciphertext = cipher->encrypt(stringtest); string cipherstring(reinterpret_cast<char*>(ciphertext)); //<-- @ point data changes in debugger outputfile.open(outfile); outputfile.close(); you're not calling string constructor should calling. instead of 1 takes single char * argument, should call 1 takes 2 arguments - char * , length. basic_string( const chart* s, size_type count, const allocator& alloc = allocator() ); to use in example unsigned char* ciphertext = cipher->encrypt(stringtest); size_t ciphertextlength = // retrieve api allows ...

html - How to center my text vertically in a circular div with css -

i wondering neglecting in css, preventing text being centered vertically? below current code, and here fiddle . here html <div class="donatebutton"><a href="#">donate</a></div> this css .donatebutton { width:100px; height:100px; background-color:#fe6d4c; -moz-border-radius: 50px; -webkit-border-radius: 50px; border-radius: 50px; margin:0 auto 30px; text-align:center; } .donatebutton:hover { background-color:#09c; } .donatebutton { display:block; width:100%; color:#ffffff; font-size:1em; text-decoration:none; padding-top:50%; line-height:1em; margin-top:0.5em; } thanks in advance insight. i want make responsive eventually, guess question :) if you're sure text 1 line can this: .donatebutton { display:block; width:100%; color:#ffffff; font-size:1em; text-decoration:none; line-height:100px; }

ios - Can't remove tapped spriteNode using removeFromParent : Swift -

i have for-loop instantiates 5 sprites such for enemy in 1...5 { negativeoncoming = skspritenode(imagenamed: "enemy3") negativeoncoming.physicsbody = skphysicsbody(circleofradius: negativeoncoming.frame.size.width/2) negativeoncoming.physicsbody?.dynamic = true negativeoncoming.physicsbody?.categorybitmask = physicscategory.negativeoncoming negativeoncoming.physicsbody?.fieldbitmask = physicscategory.negativeoncoming negativeoncoming.physicsbody?.contacttestbitmask = physicscategory.maincenternode | physicscategory.positiveoncoming negativeoncoming.physicsbody?.node?.name = "negativeoncoming" self.addchild(negativeoncoming) } declared variable globally var negativeoncoming : skspritenode! now want able remove sprite thats been tapped on once tapped. attempt did func removenegativeoncoming(negativeoncomingr:skspritenode){ println("tapped") childnodewithname("negativeoncoming")?.removefromparent()...

javascript - Unable to get simple jquery script to work on WordPress page -

i trying use jquery plugin hcaptions on wordpress website i'm developing, when mouse hovers on image information appear on image. i've been able enqueue script within theme's function-extras.php file , can see script has loaded along other scripts, script isn't handling hover event desired. @ stage i've copied , pasted suggested default code hcaptions repository have referenced own image follows: <a href="#mytoggle" class="panel"> <img src="<?php bloginfo('stylesheet_directory'); ?>/images/test-feature-image.jpg" /> </a> <div id="mytoggle" class="cap-overlay hide"> <h5>cupcakes</h5> <div class="content"> name: cupcakes.png<br /> photography: ryun shofner<br /> <a href="javascript:void(0)" class="button small"><i class="icon-edit"></i> edit</a> ...

In a Feeds architecture(like Facebook news or Twitter), how to make the feeds counts consistent with the feeds lists' length? -

i designing feeds system, 1 can post news, , others can see each other's news, twitter. now i'm saving news in hbase, , cache them in redis. approach has o(1) insert, update , remove, "count" hard achieve: if save separate count in redis, , increasing/decreasing upon insertion/removal, value can not consistent real list length in hbase: 1 single failure on network or other exception can make value wronged. if count hbase, it's time consuming. what design choice should make? hbase provides support atomic counters: instead of maintaining count in redis , relying on multiple system can use hbase (in real-time). just insert post, , if went ok, increment counter. can have multiple counters track total posts + posts per day, week, month, year... it's powerful feature. for more info hbase book has few pages dedicated counters, also, can check increment example .

Spring AOP proxies does not work with JavaFX -

good day, i'm working on project use spring aop on javafx, unfortunately, when try wrap interface used in javafx scenes receive null pointer. here stack trace. exception in application start method java.lang.reflect.invocationtargetexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:483) @ com.sun.javafx.application.launcherimpl.launchapplicationwithargs(launcherimpl.java:363) @ com.sun.javafx.application.launcherimpl.launchapplication(launcherimpl.java:303) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.met...

ctypes - Python -Why cannot change the value in the C callback function? -

i try using python ctype call c library (.so) , , c library have callback function. c source code: int showhelloword(int *result) { *result = 1025; return 55; } void bsp_show(int time,int (*callback)(int *result)) { int ret = 44; int boo = 4; while(time > 0){ --time; if(time == 0){ if(callback) { printf("boo %d\n",boo); // expect boo=4 ret = callback(&boo); printf("outfunc=%d\n",boo); // expect outfunc=1025 printf("ret=%d\n",ret); // expect ret=55 } callback = 0; } sleep(1); } } void main(){ bsp_show( 2, &showhelloword); } the print rseult : boo=4 outfunc=1025 ret=55 and seem okay. makefile source : gcc -c -fpic -wno-format-security -g main.c gcc -shared -o libcall.so main.o gcc main.o -o callback -ldl -lpthread -lrt then, try using python ctype...

Retrieve sim card contacts in android programmatically -

in android app want retrieve sim , phone contacts. if execute code separately works fine if combine phone contacts. how both contacts ??? code sim contacts : private void simcontacts() { try { string strphonename = null; string strphoneno = null; uri simuri = uri.parse("content://icc/adn"); cursor cursorsim = this.getcontentresolver().query(simuri,null,null,null,null); while (cursorsim.movetonext()) { strphonename =cursorsim.getstring(cursorsim.getcolumnindex("name")); strphoneno = cursorsim.getstring(cursorsim.getcolumnindex("number")); strphoneno.replaceall("\\d",""); strphoneno.replaceall("&", ""); strphonename=strphonename.replace("|",""); log.i("contact: ", "name: "+strphonename+" phone: "+strphoneno); } } catch(exception ...

javascript - how to hide list when user select item from list? -

could please tell me how hide list when user select item list .actually when user type on text field show list , when user select row list set value on text field .but time need hide list .so take 1 boolean variable $scope.islisthide=false; using value need hide or show list .please press "a" select value list .i use ng-show how add condition in . <div class="listcontainer" ng-show="search.stationcode" > <li ng-click="rowclick(station)" class="item" ng-repeat="station in data.data | filter:search.stationcode :startswith">{{station.stationname+"-("+station.stationcode+")"}}</li> </div> $scope.rowclick = function(station) { $scope.search.stationcode=station.stationcode; // $scope.$apply(); } here code http://codepen.io/anon/pen/zgypwj just use flag indicate whether selection has been made. here's example: http://codepen.io/anon/pen/rpwjvn i u...

mysql - SQL, HAVING clause explained -

can please explain how use having clause, dumb down as possible. looked @ texbook, w3schools, , youtube still cant wrap mind around this. don't know if im on thinking need learn this. having used filter on aggregations in group by. for example, check duplicate names: select name usernames group name having count(*) > 1 assume have table: create table `table` ( `id` int(10) unsigned not null auto_increment, `value` int(10) unsigned not null, primary key (`id`), key `value` (`value`) ) engine=innodb default charset=utf8 and have 10 columns both id , value 1 10: insert `table`(`id`, `value`) values (1, 1),(2, 2),(3, 3),(4, 4),(5, 5),(6, 6),(7, 7),(8, 8),(9, 9),(10, 10); try following 2 queries: select `value` v `table` `value`>5; -- 5 rows select `value` v `table` having `value`>5; -- 5 rows you same results, can see having clause can work without group clause. here's difference: select `value` v `table` `v`>5; error #1054 - un...

python - Why does this script get stuck in infinite loop for some cases? -

i'm re-working old python script. while running through random test cases, i'm noticing stuck in infinite loop cases, not others. script project euler problem 3 (works question prompt, never noticed random infinite loops). work 10, 19, 51, 600851475143. gets stuck in infinite loop 152. haven't tried others, thought enough test cases notice 'odd'. here's code: import sys def largestprime(n): largest_prime = 0 # initialize largest prime d = 2 # set first value factor evaluation while n > 1: # n divided each factor later on while n % d == 0: # check if n divisible factor if d > largest_prime: # check if d greater largest_prime largest_prime = d # if so, set largest_prime = d n /= d # if so, can divide n d find remaining factors d += 1 return largest_prime def main(): # make list of command line arguments, omitting [0] element # script itself. args = sys.argv[1...

android - Not Showing Update in Playstore -

Image
i pushed update application playstore. my sdk level both versions <uses-sdk android:minsdkversion="9" android:targetsdkversion="21" /> in android kitkat 4.4.4, have old version(v1.1.1) installed already. in playstore showing updated latest version(v1.1.2) but still not showing "update" option in installed mobile. when install in new mobile(android jellybean 4.1.2) installing later version(v1.1.2). can know might reason?

Extract Values from stdclass object in php -

this question exact duplicate of: how can access object property? [closed] 1 answer i have stdclass object below in php :- $sample = (object) array( "sname" => "test" ,"bselection" => "12345" ,"bind" => "1" ); i need output below - test123451 please advise how can output above. since casted object upon declaration, access other normal object, thru -> arrow operator: echo "{$sample->sname}{$sample->bselection}{$sample->bind}"; several versions work using . or , : echo $sample->sname,$sample->bselection,$sample->bind;

Batch : Use the FOR command to check the files in the folder -

i have made ​​a batch script perform following tasks : if file abc.laccdb still in update folder , show message : wait minute... . if abc.laccdb file not in 'update' folder , show message : updating data successfully. . my batch script : @echo off start update_data.vbs :check %%f in (update\abc.laccdb) ( echo wait minute... goto :check ) echo updating data pause with script above , message "wait minute ... " continuously displayed in command prompt window, though abc.laccdb file has not in update folder. if abc.laccdb file not there in update folder, bacth application run next line (echo updating data successfully) . please correct script. thank :) using mc nd 's answer: @echo off echo wait minute... start update_data.vbs ping -n 5 localhost >nul 2>nul :check if exist "update\abc.laccdb" ( ping -n 3 localhost >nul 2>nul goto :check ) echo updating data pause display ...

java - Creating XML- input data from HashMap -

i have below data in hashmap: map<string, string> data = new hashmap<string, string>(); data.put("a.b.c.c1.c11", "c11"); data.put("a.b.c.c1.c12", "c12"); data.put("a.b.c.c2.c21", "c21"); data.put("a.b.c.c2.c22", "c22"); data.put("a.b.c.c3.c31", "c31"); data.put("a.b.c.d", "d"); i have requiremrnt create xml in below format(expected output): <a> <b> <c> <c1> <c11>c11</c11> <c12>c12</c12> </c1> <c2> <c21>c21</c21> <c22>c22</c22> </c2> <c3> <c3>c3</c3> </c3> <d>d</d> </c> </b> </a> below output code generated: <a...

sqlite - Full text search example in Android -

Image
i'm having hard time understanding how use full text search (fts) android. i've read sqlite documentation on fts3 , fts4 extensions . , know it's possible on android . however, i'm having hard time finding examples can comprehend. the basic database model a sqlite database table (named example_table ) has 4 columns. however, there 1 column (named text_column ) needs indexed full text search. every row of text_column contains text varying in length 0 1000 words. total number of rows greater 10,000. how set table and/or fts virtual table? how perform fts query on text_column ? additional notes: because 1 column needs indexed, using fts table (and dropping example_table ) inefficient non-fts queries . for such large table, storing duplicate entries of text_column in fts table undesirable. this post suggests using external content table . external content tables use fts4, fts4 not supported before android api 11 . answer can assume api >= 11, comme...

Rounding Logic for decimal digits in java -

this question has answer here: round double 2 decimal places [duplicate] 13 answers i need rounding logic in following pattern..for 2.23 should 2.2 ,for 2.26 should 2.3... please out double = <ur number>; double roundoff = (double) math.round(a*10)/10; hope you. here 2.25 round off 2.3

mysql - Can not migrate a new model using Rails 3 -

i trying create new table using rails 3. first created model rails g model vendor name:string address:string . when typed rake db:migrate` gave me following error. error: mysql::error: table 'users' exists c:\site\swargadwara_puri>rake db:migrate == createusers: migrating ==================================================== -- create_table(:users) rake aborted! standarderror: error has occurred, later migrations canceled: mysql::error: table 'users' exists: create table `users` (`id` int(11) d efault null auto_increment primary key, `contact_name` varchar(255), `login_id` varchar(255), `password_hash` varchar(255), `password_salt` varchar(255), `phone ` varchar(255), `address` varchar(255), `created_at` datetime not null, `updated _at` datetime not null) engine=innodbc:/site/swargadwara_puri/db/migrate/2015041 9131135_create_users.rb:3:in `change' c:in `migrate' 20150419131135_create_users.rb class createusers < activerecord::migration ...

python - Xpath get data if conditions is satisfied in scrapy -

i using scrapy extract data. there thousands of product scraping problem data on these pages not consistent ie. <table class="c999 fs12 mt10 f-bold"> <tbody><tr> <td width="16%">type</td> <td class="c222">kurta</td> </tr> <tr> <td>fabric</td> <td class="c222">cotton</td> </tr> <tr> <td>sleeves</td> <td class="c222">3/4th sleeves</td> </tr> ...

serial port - Multiple UART connection in STM32L152RB -

i want connect 2 usart (usart1 , usart2) board. usart1 should both receive , transmit , usart2 takes output board , displays it. configured both usart1 , usart2 specific pins. can tell me how configure 2 usarts 1 can both both receive , transmit , other 1 can receive.

why is PHP/HTML file upload not working? -

i intend re-use code on http://www.w3schools.com/php/php_file_upload.asp create form allows file uploads. have used code on w3schools is(if copy-pasted it). when run error "file image - image/jpeg.sorry, there error uploading file" i'm running ubuntu 12.04 apache2 , php.ini settings upload set correctly allow file uploads

linux - Unsupported protocol while downlod tar.gz package -

i have upgrade cmake version 2.8 3.2 its working charm in cmake 2.8 but, after upgrade fail. i'm trying build third party library using externalproject_add() cmake function. externalproject_add( luacov url https://github.com/keplerproject/luacov/archive/v0.7.tar.gz download_dir ${external_project_download_dir} cmake_args -dcmake_toolchain_file=${my_toolchain_file} source_dir ${external_project_src_dir}/luacov binary_dir ${external_project_build_dir}/luacov update_command "" patch_command "" ) my observation: using git_repository option, externalproject_add() allow http , https protocol download external project. using url option, externalproject_add() allow http , not https protocol download external project. problem: is there way download , build external project using https protocol? error: [ 16%] performing download step (download, verify , extract) 'luacov' -- downloading... src='https://githu...

Can we perform search on the bases of file name inside a item in Dspace? -

dspace offers search on bases of item name if item contains multiple files can perform search on basis of item name ? how can customize dspace allow search on bases of file name inside item because item can contain multiple files ? assuming you're using solr-based search option (default since @ least dspace 4.x), fulltext file names indexed stream_name field. put stream_name:xyz search box find items have file name contains "xyz". for example, this search (xmlui) / this search (jspui) finds 2 items on demo server have file called atlas.pdf (note search results change demo server items change).

c# - Take a page shoot with Selenium Web Driver -

question , answers on take screenshot selenium webdriver contain excellent description how take screen shot selenium web driver using different languages. i drive web driver python , c# , set of different browser drivers. for example if screenshot taken phantomjs headless browser python, full page shot. in c# screenshot not directly provided driver method, bit of code needed (see above mentioned question , suggested c# solution). however, c# recipe albeit working taking screen shot, not looking for. the problem c# recipe takes screen shot, , looking how take full page shot. screen shot expected seen on screen, , browser pages larger screen. in many cases shot taken shall page shot. this question differ quoted 1 in subtle question detail makes difference in result. guess solutions page shoot different languages welcome here. screenshots in current webdriver api defined full-page screenshots. when take screenshot via webdriver, should getting them of full page, ...