Posts

Showing posts from March, 2010

mysql - insert when a particular record not found -

mysql - insert when a particular record not found - i got situation need insert if record not exist. normally, i'm going utilize 2 queries conditions this: select table -> if record not found -> insert table else -> nil i sense solution not one. how can accomplish same thing single query? example: select * user status='a' , name='lewis' if record not found insert user(status,name) values('f','lewis'); you mean like: begin if not exists (select * user status='a' , name='lewis') begin insert user (status, name) values('f','lewis') end end this works in sql server, , should possible in mysql well. edit: apparently it's not working in mysql (just testd). however, utilize insert ignore : insert ignore user2 (status, name) values('f','lewis'); note that work if have unique or primary key. another way have sam...

ruby - How to regex two sets of data -

ruby - How to regex two sets of data - i have text contains description of info , ends 2 sets of data: long text - tags:(array of tags) - url i need parse text , construction data. my thought have like: a="long text. tags:[ex1,ex2,ex3]" and utilize a = a.partition("tags:") ( partition splits text on arg) long text on a[0] , tags on a[2] , split individual tags. can problem if "tags:" in long text , can create tags: unique create work. i'm having problem on how should store url. i'm guessing partitioning string on url work, believe there improve way in regex more accommodating data. how should construction info in way allow me retrieve them stored in text? update: can tell users construction info in way, needs easy. output, need text, array of strings, , url. so example, can tell users input this: "this long text, original description have , store text in database. tags:[tag1,tag 2] url:http://g...

c# - Events in BackgroundWorker thread not firing while main thread active -

c# - Events in BackgroundWorker thread not firing while main thread active - for long, have been trying run external .bat file (calls r script statistical processing), , have console redirect u.i. i think close, have gotten work have run sizable problem! is: bloody works 1 time main thread has ended (via: return;), , not during thread.sleep, or .waitone() or etc. here code in main thread. string batloc = allrg___.rscrbin_loc + "current.bat"; backgroundworker watchboxdworker1 = new backgroundworker(); watchboxdworker1.dowork += frmc.watchboxworker1_watchext; frmc.wbresetevent = new autoresetevent(false); watchboxdworker1.runworkerasync(batloc); //thread.sleep(1000*20); //frmc.wbresetevent.waitone(); return; note commented out sleep and/or waitone() instructions. if seek , utilize these backgroundworker execute, 'events' update u.i not. the code in form (frmc above) follows, public void watchboxworker1_watchext(object sender, doworkeventa...

c++ - memory alignment into structure - alignment size equal to largest member size -

c++ - memory alignment into structure - alignment size equal to largest member size - i know why must take, alignment size of structure, alignment size equal largest fellow member size structure. example : struct mixeddata { char data1; short data2; int data3; char data4; }; if take largest fellow member (int data3) , alignment 4 bytes, have do: struct mixeddata /* after compilation in 32-bit x86 machine */ { char data1; /* 1 byte */ char padding1[1]; /* 1 byte next 'short' aligned on 2 byte boundary assuming address construction begins number */ short data2; /* 2 bytes */ int data3; /* 4 bytes - largest construction fellow member */ char data4; /* 1 byte */ char padding2[3]; /* 3 bytes create total size of construction 12 bytes */ }; but why don't have, after char data1 , char padding1[3] short data2 begins @ adress(data1) + 4 instead of char data1[1] ? and, same logic, why...

visual studio - Program adaptation for Windows CE 6.0 -

visual studio - Program adaptation for Windows CE 6.0 - hello , give thanks reading post. a few years ago, developed in company barcode application "windows mobile 6.5" using "ms visual studio 2005". this application targets mobile terminal barcode scanner , makes utilize of filesystem (database). we noticed manufacturers presently sell barcode terminals ("datalogic memor x3" example) os "microsoft windows ce 6.0 core" or "ce 6.0 pro". "how adaptable" "windows mobile 6.5" application "microsoft windows ce 6.0"? (i understand might depend on application don't know info give here. please inquire , i'll give additional info if necessary). does involve minor adaptations or hard work? we couldn't seek ourselves because having hard time setting right development environment (ide, emulator). don't know ide use. heard of "ms visual studio 2008" it's old version o...

asp.net - to get asp datagrid selected rows in a session -

asp.net - to get asp datagrid selected rows in a session - i new .net technology, utilize asp datagrid loads ' n ' number of rows. have requirement add together select rows asp datagrid infragistics webdatagrid. to add together selected rows asp datagrid infragistics webdatagrid, run loop takes selected row datagrid , add together infragistics webdatagrid. i not nail database , happens on client side. when utilize grid.get_rows().add(new_row) code, @ end of loop executing see 1st selected item asp datagrid getting added infragistics webdatagrid. it has been said in infragistics forum "infragistics webdatagrid can add together 1 row , multiple rows cannot added on client side @ 1 post back ". hence selected rows in asp datagrid in session in client side (javascript) , add together rows in session infragistics webdatagid. please help me javascript code of getting selected rows asp:datagrid in session , allow me know how can add together infrag...

maven - Spring + Unable to Load Hibernate annotation jar -

maven - Spring + Unable to Load Hibernate annotation jar - i'm getting below error. java.lang.classnotfoundexception: org.springframework.orm.hibernate3.annotation.annotationsessionfactorybean here pom.xml. please allow me know if i'm missing jar or clash between jar version files. <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>myspringmvc</groupid> <artifactid>myspringmvc</artifactid> <version>0.0.1-snapshot</version> <packaging>war</packaging> <name>myspringmvc</name> <url>http://maven.apache.org</url> <properties> <java.version>...

vba - How to split a row into columns for every three columns in excel? -

vba - How to split a row into columns for every three columns in excel? - in excel, how split row set of columns. info in a1 : g1 should in first row, a1: c1 same first row, d1: g1 should end of first row.this should go on till info in first row limited g1. the info have like b c d e ... ae af ag 1 ab 2013/01/12 2013/02/23 233 2013/02/24 2013/03/11 500 2 cd 2013/01/12 2013/02/23 233 2013/02/24 2013/03/11 343 . . 200 xx xxxx/xx/xx xxxx/xx/xx xx xxxx/xx/xx xxxx/xx/xx xxx i need split into: b c d e 1 ab 2013/01/12 2013/02/23 233 . . 1 ab 2013/02/24 2013/03/11 500 2 cd 2013/01/12 2013/02/23 233 . . 2 cd 2013/02/24 2013/03/11 343 ....

javascript - JSONP responseText on http error -

javascript - JSONP responseText on http error - i using jsonp ajax request jquery send data. when info not processed reason, homecoming result http status other 200. way can utilize access logs parse them statistics. unfortunately, don't response when status code not 200, although jquery callback in response body (when check firebug). there way grab response? class="lang-js prettyprint-override"> $.ajax({ type: 'get', url: '{{ sendmsgurl }}', async: false, data: { 'form': formdata }, datatype: 'jsonp', success: function(json2) { if (json2.status == 'ok') // stuff else { // output error }; }, error: function(xhr, status, error) { // doesn't work: never gets here alert(xhr.responsetext); var json2 = eval("("+xhr.responsetext+")"); } }).fail(function(jqxhr) { // never gets here eithe...

javascript - HTML/JS: Use anchor as default -

javascript - HTML/JS: Use anchor as default - in www, can utilize someplace#position jump #position anchor withing someplace html page. i want jump #position anchor, if no anchor specified. reason don't have command on sites link someplace , hence cannot add together #position urls everywhere. say anchor: <a class="someplace" href="#someplace">someplace</a> create click event on page load: $(document).ready(function(){ $('a.someplace').click(); }); javascript html

angularjs - How to organize frontend and backend project structure in node.js? -

angularjs - How to organize frontend and backend project structure in node.js? - in project want utilize coffeescript both backend , frontend develop in 1 programming language. below list of modules i'm going use: backend coffeescript node.js express.js mongodb redis jade stylus frontend coffeescript angular.js jade stylus note modules used both in backend , frontend: coffeescript, jade, stylus. i've used npm manage server side modules , bower manage client side modules. i've decided maintain 1 project easier maintenance , code sharing. i've used grunt javascript task runner. my questions is: is there single tool automatically generates project in configuration mentioned above , provides basic file construction , examples? structuring mean projects what you've described mean stack. there boatload of mean frameworks promote practice. consider looking @ these two, google heck out of topic if you're interested: mean.js sails.js ...

android - How do you add a SQLITE TRIGGER in ActiveAndroid -

android - How do you add a SQLITE TRIGGER in ActiveAndroid - i've managed using sqliteutils.execsql(), i'd know how can set commands within assets/migrations/.*.sql files. in theory should possible maintain getting syntax errors. android orm activeandroid

Parsing large file with MPI in C++ -

Parsing large file with MPI in C++ - i have c++ programme in want parse huge file, looking regex i've implemented. programme working ok when executed sequentially wanted run using mpi. i started adaptation mpi differentiating master (the 1 coordinates execution) workers (the ones parse file in parallel) in main function. this: mpi::init(argc, argv); ... if(rank == 0) { ... // master sends initial , ending byte every worker for(int = 1; < total_workers; i++) { array[0] = (i-1) * first_worker_file_part; array[1] = * first_worker_file_part; mpi::comm_world.send(array, 2, mpi::int, i, 1); } } if(rank != 0) readdocument(); ... mpi::finalize(); the master send every worker array 2 position contains byte start reading of file in position 0 , byte needs stop reading in position 1. the readdocument() function looks (not parsing, each worker reading part of file): void readdocument() { array = new int[2]; mpi::co...

scripting - removing extra spaces in powershell -

scripting - removing extra spaces in powershell - i'd utilize powershell remove superfluous spaces , replace them single comma between entries can convert result working csv farther analysis. here code; get-content –path c:\users\username\desktop\results.txt| foreach-object {$_ -replace "\s+" " " } | out-file -filepath c:\users\username\desktop\results.csv in text file initial resuts entry entry entry (all separated 5 spaces) what wan this entry,entry,entry so excel set them in separate cells thank time you close needed replace "," instead of " " . lets assume text files lines following. dont know if meant leading/trailing space there thats ok. " entry entry entry " get-content –path c:\users\username\desktop\results.txt| foreach-object {$_.trim() -replace "\s+" "," } | out-file -filepath c:\users\username\desktop\results.csv -encoding ascii $...

c - Where is this pointer actually pointing? -

c - Where is this pointer actually pointing? - i'm trying larn c using learncodethehardway c book. in ex19 have next code: int monster_init(void *self) { monster *monster = self; monster->hit_points = 10; homecoming 1; } int monster_attack(void *self, int damage) { monster *monster = self; printf("you attack %s!\n", monster->proto.description); monster->hit_points -= damage; if(monster->hit_points > 0) { printf("it still alive.\n"); homecoming 0; } else { printf("it dead.\n"); homecoming 1; } } object monsterproto = { .init = monster_init, .attack = monster_attack }; this object structure: typedef struct { char *description; int (*init)(void *self); void (*describe)(void *self); void (*destroy)(void *self); void *(*move)(void *self, direction direction); int (*attack)(void *self, int damage); } object; and monster structure: struct monster { object proto; ...

wordpress - Redux Framework Add Submenu -

wordpress - Redux Framework Add Submenu - i cant redux options framework working plugin. trying add together settings submenu plugin. i created simplified demo plugin , approve behaviour. <?php /** * plugin name: redux sample plugin * plugin uri: http://uri_of_page_describing_plugin_and_updates * description: brief description of plugin. * version: plugin's version number, e.g.: 1.0 * author: name of plugin author * author uri: http://uri_of_the_plugin_author * license: "slug" license name e.g. gpl2 */ require_once(plugin_dir_path(__file__) . 'inc/admin/admin-init.php'); function redux_sample_plugin_log() { } function createsettingsmenue() { $pluginslug = 'redux_sample_plugin'; //create new top-level menu add_menu_page('redux sample plugin'), 'redux sample plugin', 'administrator', $pluginslug . '_log', ...

python - pandas AttributeError: 'unicode' object has no attribute 'view' -

python - pandas AttributeError: 'unicode' object has no attribute 'view' - this killer problem has simple solution pandas newbie me: i'm trying replace 1 record of pandas dataframe (df) latest version of label (found in separate dataframe (latest_version). df.ix[label] = latest_version.ix[label] the error: attributeerror: 'unicode' object has no attribute 'view' df big , complex (and proprietary) i'd avoid posting if can; i'm hoping there's easy i'm missing can't figure out. edit: output of df.info() , latest_version.info() ipdb> df.info() <class 'pandas.core.frame.dataframe'> index: 7 entries, g info columns (total 73 columns): column 0 7 non-null object column 1 7 non-null object column 2 7 non-null object column 3 7 non-null object column 4 7 non-null object column 5 7 non-null float64 column 6 1 non-null object column 7 7 non-null object column 8 7 non-null object c...

c - Multiple threads writing on same file -

c - Multiple threads writing on same file - i know if can utilize multiple threads write binary info on same file. file *fd = openfile("test"); int size = 1000000000; int * table = sizeof(sizeof(int) * size); // .. filling table fwrite(table, sizeof(*table), size, fd); so wonder if can utilize threads,and each thread calls fssek seek different location write in same file. any thought ? fwrite should thread safe, you'll need mutex anyway, because need seek , write atomic. depending on platform, might have write function takes offset, or might able open file in each thread. improve alternative if have in memory anyway code suggests, each thread fill single big array , write out when done. c multithreading

javascript - How to execute ajax post after execution of form validation on form submit? -

javascript - How to execute ajax post after execution of form validation on form submit? - i have ajax post phone call submits contact form in rails application. function contact_email(e){ form = $('form'); $.ajax({ type: "post", url: form.attr('action'), data: form.serialize(), datatype: "json", async: false, success: function(data) { window.location = data.redirect_url; }, error: function(xhr, status) { console.log(status); } }); homecoming false; } and accompanying html : <div class="form-container"> <form name="contact_form" action="/contact" data-remote="true" class="forms" > <fieldset> <ol> <li class="form-row text-input-row name-field"> <input type="tex...

centos - repos with proxy working together with repos without it -

centos - repos with proxy working together with repos without it - i'm working reddish hat/centos linux, in 1 company have owns repositories (for secury issues) , had need of install others bundle arent in repos, made configuration in: /etc/yum.repo (the configuration proxy) proxy=server proxy_username=myuser proxy_password=mypsw /etc/sysconfig/rhn/up2date (the configuration proxy) enableproxy=1 httpproxy=server /root/.bash_profile export http_proxy="server:port" and console : export http_proxy=http://myuser:mypsw@server:port change x.repo (example remi.repo) proxy=server:port configuration after utilize lynx create 1 connection, , come in login password proxy server, , after went can bundle x.repo (for 15 min), company repos doesn't work. so question: is possible have company repo , others repo working together? if possible config proxy not doing lynx connection? and if reply yes, how it, because if not have seek install bu...

android - java.lang.IllegalStateException: opening Dialog after changing screen orientation -

android - java.lang.IllegalStateException: opening Dialog after changing screen orientation - i "java.lang.illegalstateexception: can not perform action after onsaveinstancestate" when alter screen orientation , click on image , seek open dialog. have seen superclass dialogfragment.show() transactionmanager.commit() , crashes. happens when alter orientation. don't know how avoid exception. code: public class customview extends linearlayout { .... final imageview pic=(imageview) v.findviewbyid(r.id.mypic); student_pic.setonclicklistener(new onclicklistener() { public void onclick(view v) { final mydialog picker=mydialog.newinstance(customview.this); picker.show(getcontext()); } }); } mydialog.java: public class mydialog extends dialogfragment { public static mydialog newinstance(view f) { mydialog frag = new mydialog(); homecoming frag; } ..... ...

codeigniter - curl response showing nothing using within php -

codeigniter - curl response showing nothing using within php - i trying info url using curl. i've made recursive function this. info , problem facing when no result found against curl call, page show me nothing, blank page shown.. no error @ all. i've used var_dump() testing response. found nothing. here recursive function function recursive_get_scrap($offset, $page_size, $urls, $original_array){ ini_set('max_execution_time', 1800); $of_set = $offset; $pg_size = $page_size; $off_sets = 'offset='.$of_set.'&page_size='.$pg_size.''; $url = $urls.$off_sets; $last_correct_array = $original_array; $ch1 = curl_init(); // disable ssl verification curl_setopt($ch1, curlopt_ssl_verifypeer, false); // homecoming response, if false print response curl_setopt($ch1, curlopt_returntransfer, true); curl_setopt($ch1, curlopt_header, 0); curl_setopt($ch1, curlopt_followloca...

Loading icon is not showing in jquery mobile application -

Loading icon is not showing in jquery mobile application - i have tested code in http://api.jquerymobile.com/loader/ . <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>loader demo</title> <link rel="stylesheet" href="//code.jquery.com/mobile/1.4.4/jquery.mobile-1.4.4.min.css"> <script src="//code.jquery.com/jquery-1.10.2.min.js"></script> <script src="//code.jquery.com/mobile/1.4.4/jquery.mobile-1.4.4.min.js"></script> </head> <body> <div data-role="page" id="page1"> <div role="main" class="ui-content"> <div data-role="controlgroup"> <button class="show-page-loading-msg" data-theme="b" data-textonly="false" data-textvisible=...

oracle sqldeveloper - SQL create view with sum query -

oracle sqldeveloper - SQL create view with sum query - i have next registration table | emp_id | start_date | end_date | pnum | | 1 | 2014-10-20 | 2014-10-25| 10 | | 2 | 2014-10-20 | 2014-10-30| 30 | and want next result in view | start_date | end_date | totalnum | | 2014-10-20 | 2014-10-25| 40 | | 2014-10-20 | 2014-10-30| 40 | and have tried create view sum query no success . create view emp select start_date ,end_date,(select sum(pnum) s) totalnum s grouping [start_date],end_date sql oracle-sqldeveloper

java - Instance variable in derived class has the same name with private instance variable of superclass? -

java - Instance variable in derived class has the same name with private instance variable of superclass? - is possible have instance variable in derived class has same name private instance variable in superclass? in other words, can override private instance variable or private method? yes possible declare such variable, because variable in super class private cannot seen in kid class , there no conflict. but note not same 'overriding', externally visible fellow member hidden 1 same name in kid class. java inheritance instance-variables

soundcloud - API search and site search works different -

soundcloud - API search and site search works different - as know soundcloud team using stackoverflow back upwards developers. i have simple question illustration search. in code i'm using search this: client.get('/tracks', q=query) query "prinze george - don't speak me", in result list "title" key "don't speak me" i.e there no artist name. when utilize soundcloud.com search display correct. how can total result? perhaps utilize user key find username key. api soundcloud

Default chunk length of Android HttpURLConnection.setChunkedStreamingMode()? -

Default chunk length of Android HttpURLConnection.setChunkedStreamingMode()? - in documentation of httpurlconnection.setchunkedstreamingmode(), said if specify 0 in parameter, utilize default chunk length, such as: conn.setchunkedstreamingmode(0); what exact value of default chunk length? , unit of parameter? in bytes? your question made me curious tested stuff. what exact value of default chunk length? i found here chunklength protected variable of httpurlconnection class, meaning it's accessible within class or in subclass. made subclass of httpurlconnection , tried print out chunklength class httptest extends httpurlconnection { protected httptest(url url) { super(url); log.d("chunklength", string.format("%d", this.chunklength)); this.setchunkedstreamingmode(0); log.d("chunklength", string.format("%d", this.chunklength)); } @override public void disconnect() { ...

sockets - Delete AF_UNIX file automatically? -

sockets - Delete AF_UNIX file automatically? - is there way delete file created af_unix bind() operation automatically if process crashes? no, there not. you can remove when start up, before (re)create socket. on e.g. linux can avoid creating entry in file scheme having sun_path start 0 byte - creates "abstract" socket isn't visible in filsystem - see mentioned man page more info, , vanishes when process exits. it's not entierly clear me whether standard feature or if linux specific. file sockets ipc bind shutdown

mahout recommendations on two event on similar item -

mahout recommendations on two event on similar item - i trying solve problem on mahout. question have users , courses, user can view course of study or can take course. if user viewing course of study have recommend take course. have info userid , itemid , there no preferences associated with. ex: 1 2 1 7 2 4 2 8 3 5 4 6 where in first column 1 userid , in 2nd column 2 course of study id.the twist in 2nd column can hold both viewed or/and finish of particular course.suppose coursea viewed has id 2 , same coursea taken has id 7 user 1. if user other user 1 coming , viewing coursea have predict courcea taken.now problem here if user viewing course of study not taking it, user based recommendation in mahout failed.because business perspective have give them course of study viewing should taken. need factorize dataset here or algo best suitable kind of problem. one problem viewing may not predict (and won't predict well) user wants take course. should ...

java - Use Apache Hadoop JAR files or vendor specific? -

java - Use Apache Hadoop JAR files or vendor specific? - i creating application hadoop should run on distributions of hadoop provided different vendors like: cloudera, mapr, hortonworks, pivotal...etc. application deployed on application servers weblogic, jboss or can deployed on tomcat also. question here is:- suppose version of these vendors utilize same underlying hadoop version hadoop 2.0, should utilize jar files given these vendors or utilize jar files given apache hadoop? i mean jar files have same classes apache hadoop have name in them blablacdh5.2blabla.jar , should utilize 1 or 1 apache? can build single version hadoop 2.0 , utilize vendors. can done or have build different flavours of app vendor distributions. thanks in advance it depends on how deep hadoop api threading. if application submits jobs cluster, ok vanilla libraries long stick 1 specific version. if doing advanced stuff , using hadoop internals, may necessary include vendor specific ones....

user interface - Why does this iOS code permanently tint all UIBarButtonItems? -

user interface - Why does this iOS code permanently tint all UIBarButtonItems? - this odd. found rogue line in 3rd party code: [[uitextfield appearance] settintcolor:[uicolor whitecolor]]; this code seems cause uibarbuttonitem s become permanently tinted gray. programatically tinting bar button items has no effect. i commented out code, problem went away. can tell me why? ios user-interface uiappearance

c++ - Stream insertion combined with postfix operators -

c++ - Stream insertion combined with postfix operators - say reading info in indexing starts @ 1. want indexing 0 based. why not acceptable utilize postfix increment/decrement operators after stream insertion operator? int a; std::cin >> a--; the result of post-increment operator temporary object, if increment strictly applied @ end of expression. read value, lvalue needed temporary objects aren't lvalues: bound go away. note, you'd read value temporary, retaining unspecified value in a . c++ operators postfix-operator

c++ - no viable overloaded '=' for overloaded static member functions -

c++ - no viable overloaded '=' for overloaded static member functions - i have simplified code consisting of class static function, stored in map: #include <iostream> #include <functional> #include <map> class { public: static void f(const std::string &s) { std::cout << s; } }; std::map<std::string, std::function<void(std::string const &)>> fs; int main() { fs["f"] = &a::f; fs["f"]("hello"); } this prints expected hello. the problem occurs if overload f() with: static void f(const std::string &s, int c) { while(c-->0) { std::cout << s; } } this results in error: error: no viable overloaded '=' fs["f"] = &a::f; ~~~~~~~ ^ ~~~~~ /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/functional:2241:7: note: candidate function not viable: no overload of 'f' matching 'const std::function<void (const st...

C# Smart Text and Word Extraction -

C# Smart Text and Word Extraction - not familiar stuff ngrams etc have been playing around it. what best way go extracting ngrams or set of words string "relevant" without strings dont mean anything. input example: course of study in muscle-testing , energy healing output be: muscle-testing, energy healing another input example: workout routine increment vertical jump output be: workout routine, increment vertical jump messed around stopwords etc thats flawed. any thoughts?? c#

How to use the boolean contains(Charsequence s) method in Java? -

How to use the boolean contains(Charsequence s) method in Java? - how pass desired sequence ('admin') contains method? class containstest { public static void main( string [] args) { system.out.println("enter string"); scanner s = new scanner (system.in); string s = s.next(); char = 'admin' ; boolean flag; flag = s.contains(charsequence a); if (flag == true) { system.out.println("admin mode"); } else { system.out.println("customermode"); } } } problem code in line char = 'admin' ; you cannot declare char that. there multiple characters in admin need utilize either character array or string store admin . by using char array char[] = {'a', 'd', 'm', 'i', 'n'}; i don't think need utilize character array in problem, need utili...

How can I compile a project two different ways in Travis CI? -

How can I compile a project two different ways in Travis CI? - i have project written using qt back upwards both qt4 , qt5. currently have travis configured compile project using both gcc , clang on linux , osx. i'd farther split project builds both qt4 , qt5 separate builds well, 8 different permutations in total splitting on os, compiler, , qt version. my current travis.yml is language: cpp os: - linux - osx compiler: - gcc - clang script: mkdir build && cd build && cmake .. -dwith_server=1 && create install: ./travis-dependencies.sh cache: apt qt4 vs qt5 selection configured using additional cmake parameters. how can alter split build matrix further? the recommendation travis back upwards team utilize environment variables split build: language: cpp env: - qt="-dwith_qt4=0" - qt="-dwith_qt4=1" os: - linux - osx compiler: - gcc - clang script: mkdir build && cd build &...

regex - Remove Duplicate Yara Rules with PowerShell Regular Expressions -

regex - Remove Duplicate Yara Rules with PowerShell Regular Expressions - yara rules used observe malware applying regular expressions files specific patterns in binary. maintain of yara rules in 1 text file. new rules, paste them end of text file. i'm trying right powershell 2.0 script parse through yara rules , identify , remove duplicate entries. here's format of yara rule: rule [name] { [contents] } here illustration rule: rule crowdstrike_csit_14004_02 : loader backdoor bouncer { meta: description = "deep panda compiled asp.net <http://asp.net> webshell" last_modified = "2014-04-25" version = "1.0" study = "csit-14004" in_the_wild = true copyright = "crowdstrike, inc" actor = "deep panda" strings: $cookie = "zwiz\x00" wide $cp = "es-dn" wide $enum_fs1 = "file system: {0}" wide $enum_fs2 = "available: {0} byte...

Is there any way to indicate in a URL query string that the value should be treated as an integer rather than string? -

Is there any way to indicate in a URL query string that the value should be treated as an integer rather than string? - the classic query string page?field1=john&field2=123 every server-side framework interpret field1 "john" , field2 "123" . is there way client indicate in query, 'please treat field2 123 (an integer) , not "123" (a string)'? i know can have server-side code intelligent , know field2 supposed integer, , parse integer, on client? url query-string urlencode url-encoding

awk sorting according one colum but must be printed all of them -

awk sorting according one colum but must be printed all of them - i can find way may open mind awk '{$3=cet print $0 }' < sort < awk '{cet=$3 }' file.txt input 1 00a0asd4426 18/10/2014 09:08:50 2 00a0bsdfsdf no info found 3 0asdasdsda3 25/10/2014 10:31:53 output 1 00a0asd4426 18/10/2014 09:08:50 3 0asdasdsda3 25/10/2014 10:31:53 2 00a0bsdfsdf no info found the canonical approach using sort -k : $ cat l d 1 b c 2 c b 3 test : $ sort -k2 l c b 3 b c 2 d 1 use -n switch if treat numbers , -t del whete del own delimiter (space default) sorting awk

django - How do I make my directory writable by Gunicorn? -

django - How do I make my directory writable by Gunicorn? - i have app in digital ocean, when seek create new user or item, receive next error http://pastebin.com/tgv440fu operationalerror @ /accounts/signin/ unable open database file can tell me how solve issue? django sqlite3 gunicorn digital-ocean

sql server - How to load multiple Excel Sheets in SSIS when Excel path provides as a user variable at run time -

sql server - How to load multiple Excel Sheets in SSIS when Excel path provides as a user variable at run time - i have created ssis bundle pass excel file 'path' @ run time user::variable. now want load multiple excel sheets using foreach container, when create connection in foreach container, can't utilize "ado.net schema rowset enumerator" excel file path not static. can 1 help me load multiple excel sheets when excel file path given user variable? i had today , here's best post found describing how it... http://bi-polar23.blogspot.com.au/2007/08/loading-multiple-excel-files-with-ssis.html i haven't included details in post it's quite long article. sql-server database excel ssis data-warehouse

python - How to increase update performence with addToSet -

python - How to increase update performence with addToSet - i have collection on 600000 records. records have construction below (from js console) > db.invindex.find({_id: 'katar'}).pretty() { "_id" : "katar", "place" : [ { "index" : [ 1 ], "pageid" : objectid("53fd177620ba27591133387b") }, { "index" : [ 396 ], "pageid" : objectid("53dc621420ba2708ea53c0f5") }, { "index" : [ 4 ], "pageid" : objectid("53f6e20c20ba271058d5c70c") }, { "index" : [ 18, 41 ], "pageid" : objectid("53f6e20220ba271055d5c705") }, { ...

android - Add header to (HTTP request for) file download -

android - Add header to (HTTP request for) file download - working example, utilize next code download file: url = new url(sturl); connection = (httpurlconnection) url.openconnection(); connection.addrequestproperty ("foo", "bar"); connection.setdooutput(true); // update per comment! connection.connect(); // download file = new bufferedinputstream( url.openstream(), 8192 ); os = new bufferedoutputstream( new fileoutputstream( tmp ) ); copystream( is, os ); this works fine downloading. including foo/bar header in http request fails. why? updates: download url = "http://x0data.com/android/default/rqst" i want pass headers (not or post parameters) i know server ok, because used work (for android code seem have lost...) ok, great help @greenapps. next seems include headers while downloading file: url = new url(sturl); connection = (httpurlconnection) url.openconnection(); connection.addrequestproperty (...

c++ - Converting a std string to char* using const cast -

c++ - Converting a std string to char* using const cast - after days of attempting create shell inquire bit of help. have started on 4 or times different info structures , plea solution below problem. have string need break individual arguments , have pointer that. pass args exec function since cant seem fill args correctly getting funny results, here simplified version of whats happening char* args[100]; int counter=0; string temp = "some text , stuff here"; stringstream s (temp); while(s>> temp) { cout << "token " << counter << " =" << temp <<endl; args[counter]=const_cast<char *> (temp.c_str()); counter++; } //print debug info for( int ii=0; args[ii] != null; ii++ ) { cout << "argument out " << ii << ": " << args[ii] << endl; } this code doesn't work , cant grasp why. result stores "here" in every value ...

html - What does margin auto mean? -

html - What does margin auto mean? - i checked mdn see means have auto value margin property , says: "auto replaced suitable value, e.g. can used centering of blocks." but suitable value, , suitable what? i tried myself experiments , saw if add together margin-left: auto, container goes right (like floating right): #container { background: red; width: 120px; margin-left: auto; } http://jsfiddle.net/sph2j6jx/ does mean adding margin auto "take space available"? , when add together both left , right margins centers div because tries take space left , right? auto margins depending upon circumstances, provision of auto value instructs browser render margin according value provided in own stylesheet. however, when such margin applied element meaningful width, auto margin instead causes of available space rendered whitespace. from w3.org html css margin

Android sslpeerunverifiedexception no peer certificate, JSON SSL -

Android sslpeerunverifiedexception no peer certificate, JSON SSL - i read lot of topics on web , on stack overflow.. still cannot code working right.. still getting: android sslpeerunverifiedexception no peer certificate this code, , if can help me grateful: public class mainactivity extends activity { arraylist<string> namearraylist = new arraylist<string>(); arraylist<string> countryarraylist = new arraylist<string>(); string graveurl = "https://example.com/grave.json"; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); new json().execute(); } class json extends asynctask<void, void, string> { protected void onpreexecute() { super.onpreexecute(); } protected string doinbackground(void... params) { httpclient httpclient = createhttpclient(); h...