Sunday, 15 May 2011

php - Why does the column order in a composite primary key matter to Doctrine? -



php - Why does the column order in a composite primary key matter to Doctrine? -

i'm trying set project using doctrine 2.3.2 on database-first implementation. after generating xml , mappings, calling orm:validate-schema shows me mapping right database validation fails. in using schema tool find out issues i'm finding 2 issues repeating on , over:

change varchars aren't @ 255 varchar(255) drop primary key illustration columns (a, b, c) , create new primary key same columns in different order (b, a, c)

both of these things seem meaningless change. why doctrine forcefulness me alter schema in ways seem meaningless?

the solution both of these without changing database schema is:

the convert-mapping doesn't appear add together length property id field - add together xml this appears caused difference between order of columns in table, , order of columns in primary key. re-order order of xml entries match order of primary key.

having 2 #1 i'm assuming bug - study soon. however, #2 above bug or changing order mess doctrine's logic in way?

the more think more believe oversight , not done intentionally. thinking there missing think these issues library , have added them doctrine's jira.

edit: links per request

http://www.doctrine-project.org/jira/browse/ddc-2280 http://www.doctrine-project.org/jira/browse/ddc-2281

php mysql doctrine2

c# - Keep layout the same when adding a tab [SOLUTION BELOW CODE] -



c# - Keep layout the same when adding a tab [SOLUTION BELOW CODE] -

i quite new @ c# need simple possible, have coded web browser tabs, when click add together tab opens webrowser in new tab on google.co.uk need new tab have adressbar , navigate button me able navigate url in new tab. want add together tab button adds tab totally seperate web browser , seperate adressbar , seperate navigate button. here code far:

using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; namespace windowsformsapplication1 { public partial class form1 : form { public form1() { initializecomponent(); } private void button2_click(object sender, eventargs e) { tabpage tb = new tabpage("tab"); webbrowser wb = new webbrowser(); wb.dock = dockstyle.fill; wb.navigate("www.google.co.uk"); tabcontrol1.tabpages.add(tb); tb.controls.add(wb); tabcontrol1.selecttab(tb); } private void closealtf4toolstripmenuitem_click(object sender, eventargs e) { this.close(); } private void addtabtoolstripmenuitem_click(object sender, eventargs e) { tabpage tb = new tabpage("tab"); webbrowser wb = new webbrowser(); wb.dock = dockstyle.fill; wb.navigate("www.google.co.uk"); tabcontrol1.tabpages.add(tb); tb.controls.add(wb); tabcontrol1.selecttab(tb); tb.controls.add(new textbox()); } private void button1_click_1(object sender, eventargs e) { webbrowser1.navigate(textbox1.text); } private void removetabtoolstripmenuitem_click(object sender, eventargs e) { tabcontrol1.tabpages.remove(tabcontrol1.selectedtab); } }

}

solution:

i got work usercontrol, designed usercontrol form , added tabs using code:

tabpage tb = new tabpage("tab"); menustrip ms = new menustrip(); tabcontrol1.tabpages.add(tb); tb.controls.add(ms); tb.controls.add(new usercontrol1()); tabcontrol1.selecttab(tb);

a user command best way maintain same layout. can think of panel. can maintain controls grouped , maintain same look. add together website gui panel add together panel command tabcontrol.

something like

tabpage tb = new tabpage("tab"); menustrip ms = new menustrip(); ms.items.add("add"); ms.items[0].click += new eventhandler(addmenu_click); tb.controls.add(ms); tb.controls.add(new usercontrol(tabcontrol1)); //if need update tab text tabcontrol1.tabpages.add(tb);

this create menu strip on each tabpage , user command or "panel" fill in rest.

c#

oracle11g - Oracle SQL Develop: inserting txt file to sql table by cursor -



oracle11g - Oracle SQL Develop: inserting txt file to sql table by cursor -

i start larn oracle sql develop.

i thinking write cursor read text file line line , insert sql table.

however, not sure folder need set text file.

where should set text file ?

and

i started larn cursor... can give me simple illustration cursor?

thanks

a cursor way handle results of queries whithin plsql, basically, reading file cursor doesn't create sense...

there ways how read text file plsql , insert table. in cases should start with:

put file in specific directory in file system create directory db object references file scheme directory.

now can utilize utl_file, or (imho, nicer) external tables.

sql oracle11g cursor oracle-sqldeveloper

c# - Updating progressbar from a background thread -



c# - Updating progressbar from a background thread -

i have progressbar , value binded property:

<progressbar x:name="progressbar" margin="0,2,0,0" height="20" value="{binding compasslogloadpercent}" foreground="blue" visibility="{binding compasslogloadcompleted, converter={staticresource booleantovisibilityconverter}}" tooltip="loading"> </progressbar>

and property:

public double compasslogloadpercent { { homecoming _compasslogloadpercent; } private set { if (value != _compasslogloadpercent) { _compasslogloadpercent = value; notifypropertychanged(); } } }

and in seperate thread value updated:

(int j = 0; j < lines.count(); j++) { ... compasslogloadpercent = ((double) j /lines.count())*100; }

and thread created using task:

task.run(() => { loadlogfile(filename); });

why progressbar not updating , how should prepare this?

update: more info

datacontext: (im sure datacontext correct)

clt.progressbar.datacontext = logsession;

and implementation of inotifypropertychanged

public event propertychangedeventhandler propertychanged; protected virtual void notifypropertychanged( [callermembername] string propertyname = "") { propertychangedeventhandler eventhandler = propertychanged; propertychangedeventhandler handler = propertychanged; if (handler != null) { handler(this, new propertychangedeventargs(propertyname)); } }

the problem lies somewhere in haven't shown us. basic technique sound. (in particular, there's nil wrong raising propertychanged event notifications on worker thread, because wpf's info binding scheme detects when happens, , automatically arranges update target ui element on ui thread.)

here's finish illustration work. here's xaml:

<window x:class="backgroundthreadupdate.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="350" width="525"> <grid> <progressbar x:name="progressbar" verticalalignment="top" height="20" value="{binding compasslogloadpercent}"> </progressbar> <button content="button" horizontalalignment="left" margin="10,25,0,0" verticalalignment="top" width="75" rendertransformorigin="-1.24,-0.045" click="button_click_1"/> </grid> </window>

and here's codebehind:

using system.componentmodel; using system.threading; using system.threading.tasks; using system.windows; namespace backgroundthreadupdate { public partial class mainwindow : window { private mysource _src; public mainwindow() { initializecomponent(); _src = new mysource(); datacontext = _src; } private void button_click_1(object sender, routedeventargs e) { task.run(() => { (int = 0; < 100; ++i) { thread.sleep(100); _src.compasslogloadpercent = i; } }); } } public class mysource : inotifypropertychanged { private double _compasslogloadpercent; public double compasslogloadpercent { { homecoming _compasslogloadpercent; } set { if (_compasslogloadpercent != value) { _compasslogloadpercent = value; onpropertychanged("compasslogloadpercent"); } } } public event propertychangedeventhandler propertychanged; private void onpropertychanged(string propertyname) { if (propertychanged != null) { propertychanged(this, new propertychangedeventargs(propertyname)); } } } }

this illustrates working version of technique you're trying use.

so fact yours doesn't work must due you've not shown us. possible explanations:

your ui thread might blocked. if ui threads busy, info binding updates not processed. (when info binding detects alter info source on worker thread, posts message relevant dispatcher thread, , message won't processed if dispatcher thread busy.) the info source might not in datacontext progressbar - you've not shown set context, wrong. the code raises propertychanged event (your notifypropertychanged code) might wrong - you've not shown code, , it's not clear how knows property name utilize when raising event.

to check first one, see if ui responsive user input while background work in progress. if it's not, that's why updates aren't getting through.

updated 25th feb add together relevant link

in thinking else how handle scenario, came conclusion big fit single stackoverflow answer. wrote series of blog posts performance considerations when doing non-trivial processing on background thread needs load info ui: http://www.interact-sw.co.uk/iangblog/2013/02/14/wpf-async-too-fast

c# wpf progress-bar

c++ - Compile problems: building a Composite_Key variadic template class using tuples -



c++ - Compile problems: building a Composite_Key variadic template class using tuples -

i have id class template takes parameter t.

if t has key_type defined, id calls get_key() on object of type t identifier storage. if t not have key_type defined, id utilize address of object identifier.

the code works fine point.

now, define new variadic class template composite_key takes variadic template parameters std::tuple. trying new code work id, getting wall of compilation errors having hard time understanding.

the errors seem indicate missing operator<(), odd because it's defined in id; i'm @ loss i'm doing wrong.

the code below, including test code, works fine until lastly line (commented).

code

#include <string> #include <tuple> #include <set> #include <cassert> template<typename t> struct void_ { using type = void; }; // ----------------------------------------------------------------------------- template<typename t, typename = void> struct ptr_or_key_type { using type = t const*; // our default key_type : ptr static type get_key( t const& t ) { homecoming &t; } }; template<typename t> struct ptr_or_key_type<t, typename void_<typename t::key_type>::type> { using type = typename t::key_type; // specialised key_type static type get_key( t const& t ) { homecoming t.get_key(); } }; // ----------------------------------------------------------------------------- template<typename t> class id { private: typename ptr_or_key_type<t>::type m_id; public: id( t const& t ) : m_id( ptr_or_key_type<t>::get_key( t )) { } id( id const& rhs ) : m_id( rhs.m_id ) { } ~id() { } id& operator=( id const& rhs ) { if ( &rhs!=this ) m_id = rhs.m_id; homecoming *this; } public: bool operator==( id const& rhs ) const { homecoming m_id==rhs.m_id; } bool operator!=( id const& rhs ) const { homecoming !(*this==rhs); } bool operator<( id const& rhs ) const { homecoming m_id<rhs.m_id; } bool operator<=( id const& rhs ) const { homecoming m_id<=rhs.m_id; } bool operator>( id const& rhs ) const { homecoming m_id>rhs.m_id; } bool operator>=( id const& rhs ) const { homecoming m_id>=rhs.m_id; } }; // ----------------------------------------------------------------------------- struct plain_class { }; struct string_key { using key_type = std::string; std::string m_key; string_key( std::string const& key ) : m_key( key ) { } std::string const& get_key() const { homecoming m_key; } }; struct char_key { using key_type = char; char m_key; char_key( char key ) : m_key( key ) { } char get_key() const { homecoming m_key; } }; struct int_key { using key_type = int; int m_key; int_key( int key ) : m_key( key ) { } int get_key() const { homecoming m_key; } }; template<typename... args> struct composite_key { using key_type = std::tuple<args...>; key_type m_key; composite_key( key_type const& key ) : m_key( key ) { } key_type const& get_key() const { homecoming m_key; } }; // ----------------------------------------------------------------------------- int main( int argc, char* argv[] ) { // plain_class utilize address of object key plain_class f,g; id<plain_class> id_f( f ), id_g( g ); assert( id_f!=id_g ); std::set<id<plain_class>> s; s.insert( f ); s.insert( g ); assert( s.size()==2u ); // 2 unique addresses, 2 in set // string_key utilize std::string key string_key h( "abc" ), i( "abc" ); std::set<id<string_key>> s2; s2.insert( h ); s2.insert( ); assert( s2.size()==1u ); // since sets must have unique values // effort composite key type using my_composite = composite_key<string_key,int_key,char_key>; my_composite j( std::make_tuple( string_key{ "foo" }, int_key{ 1 }, char_key{ 'c' } )), k( std::make_tuple( string_key{ "foo" }, int_key{ 1 }, char_key{ 'c' } )) ; std::set<id<my_composite>> s3; s3.insert( j ); // failure: above line compiles fine #if 0 s3.insert( k ); assert( s3.size()==1u ); // since sets must have unique values #endif }

wall of errors

in file included sandbox.cpp:2:0: /usr/include/c++/4.7/tuple: in instantiation of ‘static bool std::__tuple_compare<0ul, __i, __j, _tp, _up>::__less(const _tp&, const _up&) [with long unsigned int __i = 0ul; long unsigned int __j = 3ul; _tp = std::tuple<string_key, int_key, char_key>; _up = std::tuple<string_key, int_key, char_key>]’: /usr/include/c++/4.7/tuple:814:62: required ‘bool std::operator<(const std::tuple<_telements ...>&, const std::tuple<_elements ...>&) [with _telements = {string_key, int_key, char_key}; _uelements = {string_key, int_key, char_key}]’ sandbox.cpp:50:59: required ‘bool id<t>::operator<(const id<t>&) const [with t = composite_key<string_key, int_key, char_key>; id<t> = id<composite_key<string_key, int_key, char_key> >]’ /usr/include/c++/4.7/bits/stl_function.h:237:22: required ‘bool std::less<_tp>::operator()(const _tp&, const _tp&) const [with _tp = id<composite_key<string_key, int_key, char_key> >]’ /usr/include/c++/4.7/bits/stl_tree.h:1285:4: required ‘std::pair<std::_rb_tree_iterator<_val>, bool> std::_rb_tree<_key, _val, _keyofvalue, _compare, _alloc>::_m_insert_unique(_arg&&) [with _arg = id<composite_key<string_key, int_key, char_key> >; _key = id<composite_key<string_key, int_key, char_key> >; _val = id<composite_key<string_key, int_key, char_key> >; _keyofvalue = std::_identity<id<composite_key<string_key, int_key, char_key> > >; _compare = std::less<id<composite_key<string_key, int_key, char_key> > >; _alloc = std::allocator<id<composite_key<string_key, int_key, char_key> > >]’ /usr/include/c++/4.7/bits/stl_set.h:424:40: required ‘std::pair<typename std::_rb_tree<_key, _key, std::_identity<_key>, _compare, typename _alloc::rebind<_key>::other>::const_iterator, bool> std::set<_key, _compare, _alloc>::insert(std::set<_key, _compare, _alloc>::value_type&&) [with _key = id<composite_key<string_key, int_key, char_key> >; _compare = std::less<id<composite_key<string_key, int_key, char_key> > >; _alloc = std::allocator<id<composite_key<string_key, int_key, char_key> > >; typename std::_rb_tree<_key, _key, std::_identity<_key>, _compare, typename _alloc::rebind<_key>::other>::const_iterator = std::_rb_tree_const_iterator<id<composite_key<string_key, int_key, char_key> > >; std::set<_key, _compare, _alloc>::value_type = id<composite_key<string_key, int_key, char_key> >]’ sandbox.cpp:121:15: required here /usr/include/c++/4.7/tuple:781:63: error: no match ‘operator<’ in ‘std::get<0ul, {string_key, int_key, char_key}>((* & __u)) < std::get<0ul, {string_key, int_key, char_key}>((* & __t))’ /usr/include/c++/4.7/tuple:781:63: note: candidates are: in file included /usr/include/c++/4.7/bits/stl_algobase.h:65:0, /usr/include/c++/4.7/bits/char_traits.h:41, /usr/include/c++/4.7/string:42, sandbox.cpp:1: /usr/include/c++/4.7/bits/stl_pair.h:212:5: note: template<class _t1, class _t2> constexpr bool std::operator<(const std::pair<_t1, _t2>&, const std::pair<_t1, _t2>&) /usr/include/c++/4.7/bits/stl_pair.h:212:5: note: template argument deduction/substitution failed: in file included sandbox.cpp:2:0: /usr/include/c++/4.7/tuple:781:63: note: ‘const string_key’ not derived ‘const std::pair<_t1, _t2>’ in file included /usr/include/c++/4.7/bits/stl_algobase.h:68:0, /usr/include/c++/4.7/bits/char_traits.h:41, /usr/include/c++/4.7/string:42, sandbox.cpp:1: /usr/include/c++/4.7/bits/stl_iterator.h:299:5: note: template<class _iterator> bool std::operator<(const std::reverse_iterator<_iterator>&, const std::reverse_iterator<_iterator>&) /usr/include/c++/4.7/bits/stl_iterator.h:299:5: note: template argument deduction/substitution failed: in file included sandbox.cpp:2:0: /usr/include/c++/4.7/tuple:781:63: note: ‘const string_key’ not derived ‘const std::reverse_iterator<_iterator>’ in file included /usr/include/c++/4.7/bits/stl_algobase.h:68:0, /usr/include/c++/4.7/bits/char_traits.h:41, /usr/include/c++/4.7/string:42, sandbox.cpp:1: /usr/include/c++/4.7/bits/stl_iterator.h:349:5: note: template<class _iteratorl, class _iteratorr> bool std::operator<(const std::reverse_iterator<_iteratorl>&, const std::reverse_iterator<_iteratorr>&) /usr/include/c++/4.7/bits/stl_iterator.h:349:5: note: template argument deduction/substitution failed: in file included sandbox.cpp:2:0: /usr/include/c++/4.7/tuple:781:63: note: ‘const string_key’ not derived ‘const std::reverse_iterator<_iteratorl>’ in file included /usr/include/c++/4.7/bits/stl_algobase.h:68:0, /usr/include/c++/4.7/bits/char_traits.h:41, /usr/include/c++/4.7/string:42, sandbox.cpp:1: /usr/include/c++/4.7/bits/stl_iterator.h:1057:5: note: template<class _iteratorl, class _iteratorr> bool std::operator<(const std::move_iterator<_iteratorl>&, const std::move_iterator<_iteratorr>&) /usr/include/c++/4.7/bits/stl_iterator.h:1057:5: note: template argument deduction/substitution failed: in file included sandbox.cpp:2:0: /usr/include/c++/4.7/tuple:781:63: note: ‘const string_key’ not derived ‘const std::move_iterator<_iteratorl>’ in file included /usr/include/c++/4.7/bits/stl_algobase.h:68:0, /usr/include/c++/4.7/bits/char_traits.h:41, /usr/include/c++/4.7/string:42, sandbox.cpp:1: /usr/include/c++/4.7/bits/stl_iterator.h:1063:5: note: template<class _iterator> bool std::operator<(const std::move_iterator<_iterator>&, const std::move_iterator<_iterator>&) /usr/include/c++/4.7/bits/stl_iterator.h:1063:5: note: template argument deduction/substitution failed: in file included sandbox.cpp:2:0: /usr/include/c++/4.7/tuple:781:63: note: ‘const string_key’ not derived ‘const std::move_iterator<_iterator>’ in file included /usr/include/c++/4.7/string:54:0, sandbox.cpp:1: /usr/include/c++/4.7/bits/basic_string.h:2566:5: note: template<class _chart, class _traits, class _alloc> bool std::operator<(const std::basic_string<_chart, _traits, _alloc>&, const std::basic_string<_chart, _traits, _alloc>&) /usr/include/c++/4.7/bits/basic_string.h:2566:5: note: template argument deduction/substitution failed: in file included sandbox.cpp:2:0: /usr/include/c++/4.7/tuple:781:63: note: ‘const string_key’ not derived ‘const std::basic_string<_chart, _traits, _alloc>’ in file included /usr/include/c++/4.7/string:54:0, sandbox.cpp:1: /usr/include/c++/4.7/bits/basic_string.h:2578:5: note: template<class _chart, class _traits, class _alloc> bool std::operator<(const std::basic_string<_chart, _traits, _alloc>&, const _chart*) /usr/include/c++/4.7/bits/basic_string.h:2578:5: note: template argument deduction/substitution failed: in file included sandbox.cpp:2:0: /usr/include/c++/4.7/tuple:781:63: note: ‘const string_key’ not derived ‘const std::basic_string<_chart, _traits, _alloc>’ in file included /usr/include/c++/4.7/string:54:0, sandbox.cpp:1: /usr/include/c++/4.7/bits/basic_string.h:2590:5: note: template<class _chart, class _traits, class _alloc> bool std::operator<(const _chart*, const std::basic_string<_chart, _traits, _alloc>&) /usr/include/c++/4.7/bits/basic_string.h:2590:5: note: template argument deduction/substitution failed: in file included sandbox.cpp:2:0: /usr/include/c++/4.7/tuple:781:63: note: mismatched types ‘const _chart*’ , ‘string_key’ /usr/include/c++/4.7/tuple:808:5: note: template<class ... _telements, class ... _uelements> bool std::operator<(const std::tuple<_telements ...>&, const std::tuple<_elements ...>&) /usr/include/c++/4.7/tuple:808:5: note: template argument deduction/substitution failed: /usr/include/c++/4.7/tuple:781:63: note: ‘const string_key’ not derived ‘const std::tuple<_telements ...>’ in file included /usr/include/c++/4.7/set:60:0, sandbox.cpp:3: /usr/include/c++/4.7/bits/stl_tree.h:873:5: note: template<class _key, class _val, class _keyofvalue, class _compare, class _alloc> bool std::operator<(const std::_rb_tree<_key, _val, _keyofvalue, _compare, _alloc>&, const std::_rb_tree<_key, _val, _keyofvalue, _compare, _alloc>&) /usr/include/c++/4.7/bits/stl_tree.h:873:5: note: template argument deduction/substitution failed: in file included sandbox.cpp:2:0: /usr/include/c++/4.7/tuple:781:63: note: ‘const string_key’ not derived ‘const std::_rb_tree<_key, _val, _keyofvalue, _compare, _alloc>’ in file included /usr/include/c++/4.7/set:61:0, sandbox.cpp:3: /usr/include/c++/4.7/bits/stl_set.h:721:5: note: template<class _key, class _compare, class _alloc> bool std::operator<(const std::set<_key, _compare, _alloc>&, const std::set<_key, _compare, _alloc>&) /usr/include/c++/4.7/bits/stl_set.h:721:5: note: template argument deduction/substitution failed: in file included sandbox.cpp:2:0: /usr/include/c++/4.7/tuple:781:63: note: ‘const string_key’ not derived ‘const std::set<_key, _compare, _alloc>’ in file included /usr/include/c++/4.7/set:62:0, sandbox.cpp:3: /usr/include/c++/4.7/bits/stl_multiset.h:702:5: note: template<class _key, class _compare, class _alloc> bool std::operator<(const std::multiset<_key, _compare, _alloc>&, const std::multiset<_key, _compare, _alloc>&) /usr/include/c++/4.7/bits/stl_multiset.h:702:5: note: template argument deduction/substitution failed: in file included sandbox.cpp:2:0: /usr/include/c++/4.7/tuple:781:63: note: ‘const string_key’ not derived ‘const std::multiset<_key, _compare, _alloc>’ /usr/include/c++/4.7/tuple:781:63: error: no match ‘operator<’ in ‘std::get<0ul, {string_key, int_key, char_key}>((* & __t)) < std::get<0ul, {string_key, int_key, char_key}>((* & __u))’ /usr/include/c++/4.7/tuple:781:63: note: candidates are: in file included /usr/include/c++/4.7/bits/stl_algobase.h:65:0, /usr/include/c++/4.7/bits/char_traits.h:41, /usr/include/c++/4.7/string:42, sandbox.cpp:1: /usr/include/c++/4.7/bits/stl_pair.h:212:5: note: template<class _t1, class _t2> constexpr bool std::operator<(const std::pair<_t1, _t2>&, const std::pair<_t1, _t2>&) /usr/include/c++/4.7/bits/stl_pair.h:212:5: note: template argument deduction/substitution failed: in file included sandbox.cpp:2:0: /usr/include/c++/4.7/tuple:781:63: note: ‘const string_key’ not derived ‘const std::pair<_t1, _t2>’ in file included /usr/include/c++/4.7/bits/stl_algobase.h:68:0, /usr/include/c++/4.7/bits/char_traits.h:41, /usr/include/c++/4.7/string:42, sandbox.cpp:1: /usr/include/c++/4.7/bits/stl_iterator.h:299:5: note: template<class _iterator> bool std::operator<(const std::reverse_iterator<_iterator>&, const std::reverse_iterator<_iterator>&) /usr/include/c++/4.7/bits/stl_iterator.h:299:5: note: template argument deduction/substitution failed: in file included sandbox.cpp:2:0: /usr/include/c++/4.7/tuple:781:63: note: ‘const string_key’ not derived ‘const std::reverse_iterator<_iterator>’ in file included /usr/include/c++/4.7/bits/stl_algobase.h:68:0, /usr/include/c++/4.7/bits/char_traits.h:41, /usr/include/c++/4.7/string:42, sandbox.cpp:1: /usr/include/c++/4.7/bits/stl_iterator.h:349:5: note: template<class _iteratorl, class _iteratorr> bool std::operator<(const std::reverse_iterator<_iteratorl>&, const std::reverse_iterator<_iteratorr>&) /usr/include/c++/4.7/bits/stl_iterator.h:349:5: note: template argument deduction/substitution failed: in file included sandbox.cpp:2:0: /usr/include/c++/4.7/tuple:781:63: note: ‘const string_key’ not derived ‘const std::reverse_iterator<_iteratorl>’ in file included /usr/include/c++/4.7/bits/stl_algobase.h:68:0, /usr/include/c++/4.7/bits/char_traits.h:41, /usr/include/c++/4.7/string:42, sandbox.cpp:1: /usr/include/c++/4.7/bits/stl_iterator.h:1057:5: note: template<class _iteratorl, class _iteratorr> bool std::operator<(const std::move_iterator<_iteratorl>&, const std::move_iterator<_iteratorr>&) /usr/include/c++/4.7/bits/stl_iterator.h:1057:5: note: template argument deduction/substitution failed: in file included sandbox.cpp:2:0: /usr/include/c++/4.7/tuple:781:63: note: ‘const string_key’ not derived ‘const std::move_iterator<_iteratorl>’ in file included /usr/include/c++/4.7/bits/stl_algobase.h:68:0, /usr/include/c++/4.7/bits/char_traits.h:41, /usr/include/c++/4.7/string:42, sandbox.cpp:1: /usr/include/c++/4.7/bits/stl_iterator.h:1063:5: note: template<class _iterator> bool

answer

as indicated jmetcalf below, key classes must implement operator<(). makes sense because operator<() in id depends on std::tuple's operator<(), depends on individual types' operator<().

you need implement operator<() in key classes if want utilize them in set. std::tuple::operator<() implementation requires implemented sub-types (it compares lexicographically left right)

the error pretty obvious 1 time pick out of other irrelevant stuff:

/usr/include/c++/4.7/tuple:781:63: error: no match ‘operator<’ in ‘std::get<0 ul, {string_key, int_key, char_key}>((* & __u)) < std::get<0 ul, {string_key, int_key, char_key}>((* & __t))’

c++ c++11 tuples variadic-templates

c# - Is there a simpler way to preform projection on a ListItemCollection? -



c# - Is there a simpler way to preform projection on a ListItemCollection? -

g'day all, there way preform projection on contents of list box. i'd able without having clear , add together contents of listbox have.

public static void setselectedwhere(this listbox listbox, func<listitem,bool> condition) { var queryablelist = listbox.items.cast<listitem>(); queryablelist.select(x=>condition(x)?x.selected:x.selected=false); listbox.items.clear(); listbox.items.addrange(queryablelist.toarray<listitem>()); }

and seems silly have clear out existing collection , add together contents back.

any thoughts

what plain old iteration?

foreach (listitem item in listbox.items) { item.selected = condition(item); }

linq not reply life universe , everything. particularly part of universe involves setting properties on existing objects.

c# linq optimization webforms projection

windows runtime - Distance and other stuff between two Location in C# / WinRT -



windows runtime - Distance and other stuff between two Location in C# / WinRT -

how can distance between 2 location in c#? nice direction between 2 locations if have compass value of device.

is there api this?

it depends. mean location?

case 1: when location geographic point (latitude, longitude)

you need go through spherical geometry. in fact should create calculation on sphere (or ellipsoid or other spheroids). best way avoid doing such complicated calculation utilize microsoft.sqlserver.types.dll (v.10 or v.11). if have sql server 2012 (or 2008) installed on system, can find somewhere (otherwise may download web):

"c:\program files\microsoft sql server\110\shared\microsoft.sqlserver.types.dll"

then using dll can declare 2 sqlgeography type , phone call stdistance() method , done correctly. (remember there lost of issue here, i'm not going complicate more this). here code:

sqlgeography p1 = sqlgeography.stpointfromtext(new system.data.sqltypes.sqlchars("point( lat1, long1)"), 4326); // srid of wgs84: 4326 sqlgeography p2 = sqlgeography.stpointfromtext(new system.data.sqltypes.sqlchars("point( lat2, long2)"), 4326); // srid of wgs84: 4326 double distance = p1.stdistance(p2).value;

case 2: when location simple local 2d point (x, y) on plane

in case can utilize famous formula calculate distance:

double distance = math.sqrt(dx*dx + dy*dy); //dx , dy difference of x , y of 2 points

c# windows-runtime windows-store-apps

security - How to implement a Honeypot? -



security - How to implement a Honeypot? -

i want implement honey pot in our lab. part of work in our institution. need help , suggestion same.

"a server configured observe intruder mirroring real production system. appears ordinary server doing work, info , transactions phony. located either in or outside firewall, honeypot used larn intruder's techniques determine vulnerabilities in real system"

in practice, honeypots computers masquerade unprotected. honeypot records actions , interactions users. since honeypots don't provide legitimate services, activity unauthorized (and perchance malicious). talabis presents honeypots beingness analogous utilize of wet cement detecting human intruders

http://www.cse.wustl.edu/~jain/cse571-09/ftp/honey/index.html

this pdf white paper gives detail how can implemented.. http://www.tracking-hackers.com/conf/slides/implementing.pdf

security honeypot

javascript - this.image.width / number yields 0 -



javascript - this.image.width / number yields 0 -

i'm trying calculate width of sprite using image width, number comes out 0, why that?

function spritesheet(image, numframesx, numframesy, totalframes) { this.image = image; this.numframesx = numframesx; this.numframesy = numframesy; this.totalframes = totalframes; this.spritewidth = this.image.width / this.numframesx; this.spriteheight = this.image.height / this.numframesy; } image.onload = function() { console.log('image has been loaded'); } image.src = 'dance.png'; spritesheet = new spritesheet(image, 8, 10, 80);

spritesheet.spritewidth , spritesheet.spriteheight yields 0. cornered problem 'this.image.width' since works if set in width of image manually.

this.spritewidth = 880 / this.numframesx;

instead of

this.spritewidth = this.image.width / this.numframesx;

it works if calculate using object in console:

spritesheet.image.width / spritesheet.numframesx

yields 110

jsfiddle

how that?

window.onload = function () { console.log('image has been loaded'); image.src = 'dance.png'; spritesheet = new spritesheet(image, 8, 10, 80); }

javascript

oracle - SQL index with in clause -



oracle - SQL index with in clause -

our application has gone slow in 1 of env. alter have done changed sql. before release, sql this

select employeeid employee dept='cs' , record_state='active' , employeetypeid ='1'

after release sql

select employeeid employee dept='cs' , record_state='active' , employeetypeid in ('1','2')

the index on table employee_state_id_index (dept,record_state,employeetypeid ) index has not been changed. index not help new sql? new sql scan whole table? have no thought how indexes work in clause. appreciate help , comments

the explain plan query is

| id | operation | name | rows | bytes | cost (%cpu)| | 0 | delete statement | | 1 | 57 | 4 (0)| | 1 | delete | employee | | | | |* 2 | index range scan| employee_state_id_index | 1 | 57 | 4 (0)| -------------------------------------------------------------------------------- predicate info (identified operation id): plan_table_output 2 - access("c"."dept"='cs' , "c"."record_state"='active') filter("c"."employeetypeid"='1' or "c"."employeetypeid"='2')

the solution problem faced, reindexing table. table had 10 1000000 records , cleaned info in table (when realized had duplicate records) , reduced half of amount of records had. thought give seek reindexing, since anyway needed it. , helped :)

sql oracle indexing oracle10g in-clause

Creating Ant classpath out of project names -



Creating Ant classpath out of project names -

in ant build script have list of projects depending on. need create classpath compilation.

i have:

included.projects=projecta, projectb

and need:

included.project.classpath=../projecta/bin, ../projectb/bin

current code:

<echo message="${included.projects}" /> <pathconvert property="included.projects.classpath" dirsep="," > <map from="" to="../"/> <path location="${included.projects}"/> </pathconvert> <echo message="${included.projects.classpath}" /> <javac srcdir="${src.dir}" destdir="${build.dir}" includeantruntime="false" source="1.6"> <classpath> <pathelement path="${classpath}" /> <dirset includes="${included.projects.classpath}" /> </classpath> </javac>

i've tried explicit declaration too, didn't work:

<path id="modules.classpath"> <fileset dir="../modulea/bin" /> <fileset dir="../moduleb/bin"/> </path> <path id="libraries.classpath"> <fileset dir="lib" includes="*.jar"/> </path> <javac srcdir="${src.dir}" destdir="${build.dir}" includeantruntime="false" source="1.6"> <classpath refid="libraries.classpath" /> <classpath refid="modules.classpath" /> </javac>

i'm curious, problem explicit declaration code, , possible solve comma-separated-string classpath solution.

i think simpler explicity declare classpath @ top of build follows:

<path id="compile.path"> <fileset dir="../projecta/bin" includes="*.jar"/> <fileset dir="../projectb/bin" includes="*.jar"/> </path>

used follows:

<javac srcdir="${src.dir}" destdir="${build.dir}" includeantruntime="false" source="1.6"> <classpath> <path refid="compile.path"/> <pathelement path="${classpath}" /> </classpath> </javac>

note:

i read question 1 time again , realised you're not using jar files built other projects, you? .... not great idea....

ant classpath

add DataProperty in protege with Jena -

This summary is not available. Please click here to view the post.

ruby on rails 3 - need help distinguishing between users and tests -



ruby on rails 3 - need help distinguishing between users and tests -

i building app online tests. these tests can sent companies individual users. problem distinguising between users , tests... should set login?

i want users click link using devise's token authentication , taken test start page. should token generated tests or users? , there way track how many tokens company generating?

thanks!

ruby-on-rails-3 devise logic

java - Difference between return() and simple return -



java - Difference between return() and simple return -

i coding , simple thought (obviously question) comes mind if have function :

int fun1(int p){ return(p); }

and have function this:

int fun1(int p){ homecoming p; ==> absence of parenthesis }

so difference between 2?

no difference. can decide utilize parens if makes things clearer.

java

excel - How to step out after each warning message? -



excel - How to step out after each warning message? -

activesheet.unprotect cells.checkspelling spelllang:=2057 if range("f4").value = 1 msgbox "marked budget not equal total! please amend required" application.run "latestmediaplanversion.xlsm!final"

i have 2 pieces of code yield warning boxes. @ moment these pop don't eject macro.. i.e want ensure line:

application.run......

is reached if don't prompt warning box. the right code this?.

change code to:

activesheet.unprotect cells.checkspelling spelllang:=2057 if range("f4").value = 1 msgbox "marked budget not equal total! please amend required" exit sub else application.run "latestmediaplanversion.xlsm!final" end if

excel vba

How can I filter just a specific application android Logcat logs in IntelliJ IDE/IDEA? -



How can I filter just a specific application android Logcat logs in IntelliJ IDE/IDEA? -

i recently, alter ide eclipse intellij ide/idea android development according lot feedback intellij.

in general seems enough, there 1 thing can't handle it. can filter logs application. eclipse users knows when run programme ide adds filter running application. can read logs out spamming logs of system/other apps .

so questions are; there option/method filtering application ?

ps: there answered question on stackoverflow related title, accepted reply can't plenty me or other developer because of it's inefficient. can't waste time changing pid every restart of app.

maybe question can't answered but,it can remain open discussions.

edit : at latest version of intellij water ice called cardea solved problem.

please vote feature request, it's looking for.

your question duplicate of one:

can idea's logcat filter automatically recognize running app?

android filter intellij-idea logcat

Scraping flash using HtmlUnit or other java tool -



Scraping flash using HtmlUnit or other java tool -

i using htmlunit scrap date site after login info displayed using adobe flash player swf object, don't know way scrap info such page.

is there way extract info flash page, if yes please help me out, either using htmlunit or other java tool.

thanks.

there no way can interact flash applet using htmlunit. can seek selenium; never used it, looks there plugins enable flash communication flash selenium

personally, think way test user interfaces, when have such pitfalls, hire tester human beingness (a one), , teach developers test gui every time alter it.

java flash htmlunit

smooth streaming - Azure Media Services Shared Access Policy limitations -



smooth streaming - Azure Media Services Shared Access Policy limitations -

i'm trying create time-limited url's smooth streaming of media stored in azure media services.

i working against code supplied here. windows azure smooth streaming example

i upload video file new asset. encode video file using azure media service encoding preset "h264 adaptive bitrate mp4 set 720p". resulting encoded asset, effort create streaming url creating access policy , locator, utilize generate url used streaming.

here code:

string urlforclientstreaming = ""; iassetfile manifestfile = (from f in asset.assetfiles f.name.endswith(".ism") select f).firstordefault(); if (manifestfile != null) { // create 1 hr readonly access policy. iaccesspolicy policy = _mediacontext.accesspolicies.create("streaming policy", timespan.fromhours(1), accesspermissions.read); // create locator streaming content on origin. ilocator originlocator = _mediacontext.locators.createlocator(locatortype.ondemandorigin, asset, policy, datetime.utcnow.addminutes(-5)); urlforclientstreaming = originlocator.path + manifestfile.name + "/manifest"; if (contenttype == mediacontenttype.hls) urlforclientstreaming = string.format("{0}{1}", urlforclientstreaming, "(format=m3u8-aapl)"); } homecoming urlforclientstreaming;

this works great. until 6th time execute code against same asset. receive error:

"server not back upwards setting more 5 shared access policy identifiers on single container."

so, that's fine. don't need create new accesspolicy everytime, can reuse 1 i've created previously, build locator using same policy. however, then, error 5 shared access policies on single container.

here new code creates locator same accesspolicy used previously:

string urlforclientstreaming = ""; iassetfile manifestfile = (from f in asset.assetfiles f.name.endswith(".ism") select f).firstordefault(); if (manifestfile != null) { // create 1 hr readonly access policy iaccesspolicy accesspolicy = null; accesspolicy = (from p in _mediacontext.accesspolicies p.name == "myaccesspolicy" select p).firstordefault(); if (accesspolicy == null) { accesspolicy = _mediacontext.accesspolicies.create("myaccesspolicy", timespan.fromhours(1), accesspermissions.read); } // create locator streaming content on origin. ilocator originlocator = _mediacontext.locators.createlocator(locatortype.ondemandorigin, asset, policy, datetime.utcnow.addminutes(-5)); urlforclientstreaming = originlocator.path + manifestfile.name + "/manifest"; if (contenttype == mediacontenttype.hls) urlforclientstreaming = string.format("{0}{1}", urlforclientstreaming, "(format=m3u8-aapl)"); } homecoming urlforclientstreaming;

i don't understand why it's saying i've created 5 shared access policies. in case of sec block of code, ever create 1 access policy. can verify there ever 1 accesspolicy viewing content of _mediacontext.accesspolicies, there 1 access policy in list.

at point have many users requesting access same asset. url's provided these clients need time limited per our clients requirements.

is not appropriate means create url smooth streaming of asset?

now azure media services content protection feature, encrypt media file either aes or playready, generate long-lived locator. @ same time, set token-authorization policy content key, token duration set short-period of time (enough player retrieve content key). way command content access. more information, refer blog: http://azure.microsoft.com/blog/2014/09/10/announcing-public-availability-of-azure-media-services-content-protection-services/

azure smooth-streaming azure-media-services

c# - Implementing custom IComparer (with example) -



c# - Implementing custom IComparer<> (with example) -

ive written next code, order strings native string.compare() allow collection of exceptions (in case custompriority) place priority on default string.compare() function.

it seems bit long winded, wondering if there built .net allow this?

var unorderered = new[] { "a", "b", "c", "x", "y", "z" }; var ordered = unorderered.orderby(a => a, new customstringcomparer()); //expected order y,x,a,b,c,z class customstringcomparer : icomparer<string> { int icomparer<string>.compare(string x, string y) { if (x == y) homecoming 0; else { //---------------------------- //beginning of custom ordering var custompriority = new[] { "y", "x" }; if (custompriority.any(a => == x) && custompriority.any(a => == y)) //both in custom ordered array { if (array.indexof(custompriority, x) < array.indexof(custompriority, y)) homecoming -1; homecoming 1; } else if (custompriority.any(a => == x)) //only 1 item in custom ordered array (and x) homecoming -1; else if (custompriority.any(a => == y)) //only 1 item in custom ordered array (and y) homecoming 1; //--------------------------- //degrade default ordering else homecoming string.compare(x, y); } } }

first, think it's useful restate problem: want sort by:

the index in given array; if item not in array, index infinity the string itself

that means can accomplish sort order using orderby() first status followed thenby() sec one:

private static uint negativetomaxvalue(int i) { if (i < 0) homecoming uint.maxvalue; homecoming (uint)i; } … var ordered = unorderered .orderby(a => negativetomaxvalue(array.indexof(new[] { "y", "x" }, a))) .thenby(a => a);

negativetomaxvalue() necessary, because items not in array should last, first normally, because index -1. (a hackish , unreadable way same straight cast result of indexof() uint.)

if wanted reuse sorting creating icomparer, believe there nil in .net help that. utilize comparerextensions instead:

icomparer<string> comparer = keycomparer<string> .orderby(a => negativetomaxvalue(array.indexof(new[] { "y", "x" }, a))) .thenby(a => a);

c# compare order icomparer

jax rs - Jboss 7.1.1 - Jackson ContextResolver works only on one deployment -



jax rs - Jboss 7.1.1 - Jackson ContextResolver<ObjectMapper> works only on one deployment -

i have 2 rest webapps want deploy on jboss 7.1.1. server.

rest requests in both apps produces , consumes json. utilize jackson provider serialize , deserialize objects.

now, need custom objectmapper configurations each webapp. resolve problem added @provider classes implementing contextresolver. 1 each project. fe. 1 of class looks that:

@provider @produces(mediatype.application_json) @consumes(mediatype.application_json) public class jacksonconfig implements contextresolver<objectmapper> { private final objectmapper objectmapper; public jacksonconfig() { objectmapper = new objectmapper(); objectmapper.configure(serializationconfig.feature.wrap_root_value, true); } @override public objectmapper getcontext(class<?> objecttype) { homecoming objectmapper; } }

it works when deploy 1 of projects on jboss. when seek deploy both, first initialized project utilize defined objectmapper. other 1 never calls getcontext method contextresolver class. wrong?

edit!:

after lot of trials decided alter method of parsing json jackson staxon. hoped @ to the lowest degree method work well. not... serialization works on both deployed applications. again, somehow jboss decided utilize jackson instead of staxon in deserialization process. 1 time again application phone call first after deployment works well. sec 1 using jackson (no thought why...) calls exceptions. always...

is there problem jboss? i'm doing wrong have no thought where. has thought should look?

looks found solution problem. known issue of resteasy, can removed build-in option:

to solve problem had add together param web.xml of projects:

<context-param> <param-name>resteasy.use.deployment.sensitive.factory</param-name> <param-value>false</param-value> </context-param>

i found solution in resteasy jira. it's unusual me there no info in jboss or resteasy related documentation...

jackson jax-rs jboss7.x resteasy

Adding dates from SQL in PHP (types Datetime + Time) -



Adding dates from SQL in PHP (types Datetime + Time) -

i'd add together 2 values mysql database in php app. 1 stored datetime type, other 1 time.

$datetime; // "2013-02-08 14:00:00" $time; // "01:00:00"

i'd add together 1 hr $datetime, doesn't give me right result:

$newdatetime = strtotime($datetime) + strtotime($time); echo date('y-m-d h:i:s', $newdatetime); // "1920-02-11 08:31:44"

how can correctly?

$dt = new datetime("2013-02-08 14:00:00"); $dt->modify('+1 hour'); echo $dt->format('y-m-d h:i:s');

see in action

php sql date datetime

parallel processing - *** glibc detected *** ./PatMatch: double free or corruption (out): 0x00007fff202798d0 *** -



parallel processing - *** glibc detected *** ./PatMatch: double free or corruption (out): 0x00007fff202798d0 *** -

i have written opencl programme implement pattern matching algorithm. input, programme takes 2 two-dimensional arrays of characters. first array list of strings row corresponds string. same holds sec array, used hold list of patterns. @ end of each row null-terminator('\0') appended indicate end of string while string beingness processed in kernel.

each work item matches single string every patterns , keeps record of number of patterns matched, , count written global buffer.

the programme seems run end , prints number of matches in each string. when programme terminates error message couldn't figure out why?

i couldn't proceed further, need help. below i've listed kernel function used , error message.

thanks.

error message memory map.

*** glibc detected *** ./patmatch: double free or corruption (out): 0x00007fff202798d0 *** ======= backtrace: ========= /lib64/libc.so.6[0x377c47247f] /lib64/libc.so.6(cfree+0x4b)[0x377c4728db] ./patmatch[0x4016b6] /lib64/libc.so.6(__libc_start_main+0xf4)[0x377c41d9b4] ./patmatch[0x400d99] ======= memory map: ======== 00400000-00402000 r-xp 00000000 fd:00 41583479 /home/haileyesus/spd/patmatch 00601000-00602000 rw-p 00001000 fd:00 41583479 /home/haileyesus/spd/patmatch 06e10000-0749e000 rw-p 06e10000 00:00 0 [heap] 4063c000-4063d000 ---p 4063c000 00:00 0 ........ ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0 [vsyscall] aborted

i have single kernel function , 1 string manipulation non-kernel function.

__global char* strstr(__global char *haystack, __global char *needle) { if(!*needle) homecoming haystack; __global char *tempstr = haystack; while(*tempstr) { __global char *pos = tempstr; __global char *tempneedle = needle; while(*tempstr && &tempneedle && *tempstr == *tempneedle) { tempstr++; tempneedle++; } if(!*tempneedle) homecoming pos; tempstr = pos + 1; } homecoming '\0'; } __kernel void matchpatterns_v1(__global char *strings, __global char *patterns, __global int *matchcount,int strcount, int strlength, int patcount, int patlength) { int id = get_global_id(0); int rowindex = id*strlength; int i, matches = 0; __global char *pos = strings; __global char *temp = strings; __global char *pat = patterns; for(i = 0; < patcount; i++) { temp = &strings[rowindex]; pat = &patterns[i*patlength]; while(pos != '\0') { pos = strstr(temp, pat); if(pos != '\0') { matches++; temp = pos + patlength; } } } matchcount[id] = matches; }

parallel-processing opencl

javascript - one query from multiple APIs -



javascript - one query from multiple APIs -

is possible create 1 query api's different sources? ie,

in traditional web development if have next modules:

clients: clientid, clientname orders: ordersid, clientid

i create 2 tables in 1 database , foreign keys joins , create query.

what instead of 1 database create 2 databases, 1 each module (this way can expand each module it's own entity easier) , "tie" 2 databases through apis.

so, still utilize "foreign keys" (ie, clientid in orders table) "tie" clients , orders, not "join" them because not in same database.

so, in interface have a:

client api http:mysite.com/showallclientsapi ordersapi http:mysite.com/showallordersapi

how query (or possible) though apis between modules response:

salea clientname 1 clientname 2 etc saleb clientname 1 clientname 3

i show orders(http://mysite.com/showsalesapi) have clientid=1 give me json response clientid , not clientname.

does create sense?

(you might inquire why want this. part of multi module application create sense maintain modules separate part of huge database, future development or interaction other applications)

any thoughts?

i thought of splitting out databases , putting them behind services, think should done care. if going joins between clients , orders, why create them communicate via services?

some thoughts:

maybe replicate info server server client/order queries can happen quickly. way each server still authoritative.

you can bring together entities in code of course. write wrappers sit down on top of each api , (c#):

list clientnames = new list(); var orders = orderservice.getorders(); foreach (var order in orders) { var client = clientservice.getclient(order.clientid); clientnames.add(client.firstname + " " + client.lastname); }

(note: inefficient, might want pass list of client ids)

something above phone call 2 services in simple way , "join" them in application. if feels much work, consider replication! =)

use mule (http://www.mulesoft.org/) handle integration of services. mule can create endpoints rest services (or http web service) , bring together them 1 "message".

no matter do, if split info across servers, going pay little higher cost queries. can't imagine performance anywhere near if entities on same server/database.

javascript api web-applications

Rails & Postgresql create a field that auto increments from 1 -



Rails & Postgresql create a field that auto increments from 1 -

i'm looking create field called id_visual in table orders starts @ 1 , auto increments there. create method in model thought there must improve more foolproof way. ideas?

from can tell, want secondary id based on primary id? identity key can table based , can not dependent on key. have in code , save new field on before_create. easiest way each order want id, count of orders less or equal 1 working based on whatever primary key is. simple 1 query calculation.

ruby-on-rails-3 postgresql auto-increment

jquery plugins - jqgrid is freaking out when gets 2 ajax calls -



jquery plugins - jqgrid is freaking out when gets 2 ajax calls -

i using jqgrid app , works fine, have problem when jqgrid gets 2 different ajax calls 1 1 fast, want relate sec ajax call, freaks out. have thought resolve this?

i can't give peek on code, mean seek reload info , meanwhile press anther button , want him reload anther info instead. @ fiddler , 2 ajax calls gets fine

kill first request part of sec call. see abort ajax requests using jquery illustration of killing ajax request.

jquery-plugins jqgrid

php - What's are some reliable ways to identify suspicious logins? -



php - What's are some reliable ways to identify suspicious logins? -

i'm interested in implementing feature on web application warns users when suspicious log in has occurred since lastly visit.

my kneejerk reaction utilize client's ip address, after doing research seems terrible idea. dynamic allocation , nat suggest not reliable.

my sec thought utilize geolocation service. ones find either ip-based or outside of price-range.

my 3rd thought implement facebook's "register device" prompt, i'm unsure how works in reliable way.

does have ideas on how identify device or location reasonable level of confidence?

it depends on business rules. score based on several factors.

not same ip: +5 not same subnet: +10 not same country: +100 3 or more attempts before success: +50 2 or more logins @ same time: +50 different browser lastly time: +5

etc.

then setup rules say:

0-20: tell user on next successful login. 21-50: start making them wait 5 minutes between logins. 51-100: lock business relationship , forcefulness them unlock via email confirmation.

i show them lastly date , ip of login gmail does. gmail has login history can view.

php javascript web-applications ip

Inverted HashMap in Java whit frequency -



Inverted HashMap in Java whit frequency -

i have hashmap<string, linkedlist<integer>> , want create hashmapinverted<linkedlist<integer>, set<string>> contains in keys lists, values of first map, , values set of strings have same list in first map.

how can this?

you can do:

map<linkedlist<integer>, set<string>> mapinverted = new hashmap<>(mymap.size()); for(entry<<string, linkedlist<integer>> entry : mymap.entryset()) { string key = entry.getkey(); linkedlist<integer> list = entry.getvalue(); set<string> strings = mapinverted.get(list); if(strings == null) { // list has not been set in map strings = new hashset<string>(); // create new set mapinverted.put(list, strings); // set list , new set } strings.add(key); }

java

filter - SML: Filtering list non-recursively -



filter - SML: Filtering list non-recursively -

i'm trying filter list non-recursively i'm not sure how go going it. simple example, have list [1, 2, 3, 4, 5, 6, 7] , want filter returns list of numbers greater 3, ie [4, 5, 6, 7].

i can recursively no problem i'm stuck here. unfortunately, i'm new sml , best can think of using map don't think map made this.

you're right: map wasn't made - list produced map have same size list given map.

list.filter was made this. if phone call list.filter function argument returns true if number greater 3, want.

list filter sml

php - echo multiple variables with a space between each into echo'd table cell -



php - echo multiple variables with a space between each into echo'd table cell -

<?php if(isset($_session['guest2first'])) echo '<tr><td>'; echo '<input type="text" name="guest2ticket" id="guest2ticket" onblur="isticketnumber(this)" size ="22"/>'; echo '</td><td>'; echo $first["guest2first"] , ' ', $middle["guest2middle"] , ' ',$last["guest2last"]; echo '</td></tr>'?>

i have form uses $_session variables fill in of content using code above.

what need

check if variable set if echo out new table row containing 2 cells in first cell echo out input box in sec cell echo out 3 variables space between each

everything seems work fine except number 4. nil is echo'd sec cell.

im sure

echo $first["guest2first"] , ' ', $middle["guest2middle"] , ' ',$last["guest2last"];

is problem. how can prepare syntax accomplish desired result?

i think mixed var names , mean $_session, instead of $first, $middle, $last

<?php if(isset($_session['guest2first'])) echo '<tr><td>'; echo '<input type="text" name="guest2ticket" id="guest2ticket" onblur="isticketnumber(this)" size ="22"/>'; echo '</td><td>'; echo $_session["guest2first"] , ' ', $_session["guest2middle"] , ' ',$_session["guest2last"]; echo '</td></tr>'?>

php echo

Call Python function (Flask) from JavaScript file (melonJS) game on Facebook -



Call Python function (Flask) from JavaScript file (melonJS) game on Facebook -

i've looked through many topics on stackoverflow, github, google , many more... , found many different answers although no simple answer.

i'm writing facebook game in javascript (using melonjs engine). framework flask (python).

what trying do, have ability send info between python , js code no need refresh page (like database operations, email sending, etc.). want user see game, take options, play , game rest.

while have managed see below work:

app.py

def add(f,l,a): g.db.execute('insert persons (fname,lname,age) values (?, ?, ?)', [f,l,a]) g.db.commit() @app.route('/') def index(): cur = g.db.execute('select fname, lname, age persons order id desc') entries = [dict(fname=row[0], lname=row[1], age=row[2]) row in cur.fetchall()] homecoming render_template('app.html',entries=entries,addtodb=add)

app.html

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>the game</title> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta name="generator" content="geany 1.22" /> <script type="text/javascript" src="jquery-1.7.1.min.js"></script> <script type="text/javascript"> var adddb = '{{addtodb('anne','monk','12')}}'; </script> </head> <body> {{addtodb('allie','monk','78')}} <ul class=entries> {% entry in entries %} <li><h2>{{ entry.fname }} {{ entry.lname|safe }} </h2> age: {{ entry.age }}</li> {% else %} <li><em>unbelievable. no entries here far</em></li> {% endfor %} </ul> </body> </html>

and both {{addtodb}} work. wonder how send function file.js linked html (like jquery above), not set straight inside. "{{...}}" not work checked. suppose have find module python or utilize ajax maybe, except have no thought start.

the reply "ajax", simplified elaboration help point in right direction:

you need create kind of js event (clicking link, clicking button, event firing in game) trigger asynchronous (i.e. doesn't wait server's response) or synchronous (i.e. wait hear back) phone call flask endpoint on server (i.e. route set up) request. if you're creating new entry, that's post request. validate on server , save database.

if want page reflect happened result of server's behavior database, flask endpoint needs homecoming json response. since generated html , js that's on page, function in js needs bound event listener looking json response, parses json , executes whatever code set in function.

jquery's ajax functionality you. here illustration of jquery ajax post. doesn't matter illustration uses php; parse post in flask view , homecoming jsonify(data). see docs on flask.jsonify.

javascript python facebook flask

asp.net mvc 3 - Random "Missing type map configuration or unsupported mapping." Error in Automapper -



asp.net mvc 3 - Random "Missing type map configuration or unsupported mapping." Error in Automapper -

my entity:

/// <summary> /// get/set name of country /// </summary> public string countryname { get; set; } /// <summary> /// get/set international code of country /// </summary> public string countrycode { get; set; } /// <summary> /// get/set coordinate of country /// </summary> public coordinate countrycoordinate { get; set; } /// <summary> /// get/set cities of country /// </summary> public virtual icollection<city> cities { { if (_cities == null) { _cities = new hashset<city>(); } homecoming _cities; } private set { _cities = new hashset<city>(value); } }

my dto:

public guid id { get; set; } public string countryname { get; set; } public string countrycode { get; set; } public string lattitude { get; set; } public string longtitude { get; set; } public list<citydto> cities { get; set; }

my configuration

// country => countrydto var countrymappingexpression = mapper.createmap<country, countrydto>(); countrymappingexpression.formember(dto => dto.lattitude, mc => mc.mapfrom(e => e.countrycoordinate.lattitude)); countrymappingexpression.formember(dto => dto.longtitude, mc => mc.mapfrom(e => e.countrycoordinate.longtitude));

in global.asax application_start have:

bootstrapper.initialise();

and in bootstrapper have:

public static class bootstrapper { private static iunitycontainer _container; public static iunitycontainer current { { homecoming _container; } } public static void initialise() { var container = buildunitycontainer(); dependencyresolver.setresolver(new unitydependencyresolver(container)); } private static iunitycontainer buildunitycontainer() { _container = new unitycontainer(); _container.registertype(typeof(boundedcontextunitofwork), new perresolvelifetimemanager()); _container.registertype<icountryrepository, countryrepository>(); _container.registertype<itypeadapterfactory, automappertypeadapterfactory>(new containercontrolledlifetimemanager()); _container.registertype<icountryappservice, countryappservices>(); entityvalidatorfactory.setcurrent(new dataannotationsentityvalidatorfactory()); var typeadapterfactory = _container.resolve<itypeadapterfactory>(); typeadapterfactory.setadapter(typeadapterfactory); homecoming _container; } }

where adapter is:

public class automappertypeadapter : itypeadapter { public ttarget adapt<tsource, ttarget>(tsource source) tsource : class ttarget : class, new() { homecoming mapper.map<tsource, ttarget>(source); } public ttarget adapt<ttarget>(object source) ttarget : class, new() { homecoming mapper.map<ttarget>(source); } }

and adapterfactory is:

public automappertypeadapterfactory() { //scan assemblies find auto mapper profile var profiles = appdomain.currentdomain .getassemblies() .selectmany(a => a.gettypes()) .where(t => t.basetype == typeof(profile)); mapper.initialize(cfg => { foreach (var item in profiles) { if (item.fullname != "automapper.selfprofiler`2") cfg.addprofile(activator.createinstance(item) profile); } }); }

so randomly "missing type map configuration or unsupported mapping." error pointing:

public ttarget adapt<ttarget>(object source) ttarget : class, new() { homecoming mapper.map<ttarget>(source); }

while error occurs randomly hard debug , see happens. have searched lot no proper solution.

the error goes like:

missing type map configuration or unsupported mapping.

mapping types: country -> countrydto myapp.domain.boundedcontext.country -> myapp.application.boundedcontext.countrydto

destination path: list`1[0]

source value: myapp.domain.boundedcontext.country

my project mvc 3 project automapper 2.2 , unity ioc..

i appreciate idea, advice or solution , answers.

if utilize mapper.assertconfigurationisvalid(); bit more detailed info:

unmapped members found. review types , members below. add together custom mapping expression, ignore, add together custom resolver, or modify source/destination type

in case, have have mapped properties of destination model. missing citydto , id. here:

mapper.createmap<city, citydto>(); mapper.createmap<country, countrydto>() .formember(dto => dto.id, options => options.ignore()) .formember(dto => dto.longtitude, mc => mc.mapfrom(e => e.countrycoordinate.longtitude)) .formember(dto => dto.lattitude, mc => mc.mapfrom(e => e.countrycoordinate.lattitude));

maybe need additional mapping on city-citydto, did not specify them.

asp.net-mvc-3 unity-container automapper-2

Unable to compile MacVim with filedrawer on OSX 10.7.5 -



Unable to compile MacVim with filedrawer on OSX 10.7.5 -

i unable compile alloy's fork of macvim on os x 10.7.5. have xcode 4.6 installed, up-to-date command line tools. (i aware there homebrew formula version of macvim, macports user, , rather not switch homebrew resolve this.) tried running "cc=clang ldflags=-l/usr/lib ./configure ...." still nail errors. help appreciated!

i have heard macvim has issues compiling ruby 1.9, used scheme ruby (after trying multiple times 1.9.3 , 1.9.2):

$ rvm scheme $ ruby -v ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0] $ ./configure --with-features=huge --enable-rubyinterp $ cd src && create first xcodebuild -project macvim/macvim.xcodeproj === build native target psmtabbarcontrolframework of project psmtabbarcontrol default configuration (release) === check dependencies compilec ../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmoverflowpopupbutton.o source/psmoverflowpopupbutton.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler cd /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol setenv lang en_us.us-ascii /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -wno-trigraphs -fpascal-strings -os -wno-missing-field-initializers -wno-missing-prototypes -wreturn-type -wno-implicit-atomic-properties -wno-receiver-is-weak -wformat -wno-missing-braces -wparentheses -wswitch -wno-unused-function -wno-unused-label -wno-unused-parameter -wunused-variable -wunused-value -wno-empty-body -wno-uninitialized -wno-unknown-pragmas -wno-shadow -wno-four-char-constants -wno-conversion -wno-constant-conversion -wno-int-conversion -wno-enum-conversion -wno-shorten-64-to-32 -wpointer-sign -wno-newline-eof -wno-selector -wno-strict-selector-match -wno-undeclared-selector -wno-deprecated-implementations -fasm-blocks -fstrict-aliasing -wprotocol -wdeprecated-declarations -wno-sign-conversion -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/psmtabbarcontrol.hmap -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/release/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/derivedsources/x86_64 -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/derivedsources -f/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/release -include /var/folders/2x/_8nyw24s4bv5ccy2z6gf9hd80000gp/c/com.apple.xcode.502/sharedprecompiledheaders/appkit-dznbmxptlydmqxbpwpoxawqdnnsw/appkit.h -mmd -mt dependencies -mf /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmoverflowpopupbutton.d --serialize-diagnostics /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmoverflowpopupbutton.dia -c /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/source/psmoverflowpopupbutton.m -o /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmoverflowpopupbutton.o fatal error: file '/usr/include/sys/types.h' has been modified since precompiled header built 1 error generated. compilec ../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmmetaltabstyle.o source/psmmetaltabstyle.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler cd /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol setenv lang en_us.us-ascii /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -wno-trigraphs -fpascal-strings -os -wno-missing-field-initializers -wno-missing-prototypes -wreturn-type -wno-implicit-atomic-properties -wno-receiver-is-weak -wformat -wno-missing-braces -wparentheses -wswitch -wno-unused-function -wno-unused-label -wno-unused-parameter -wunused-variable -wunused-value -wno-empty-body -wno-uninitialized -wno-unknown-pragmas -wno-shadow -wno-four-char-constants -wno-conversion -wno-constant-conversion -wno-int-conversion -wno-enum-conversion -wno-shorten-64-to-32 -wpointer-sign -wno-newline-eof -wno-selector -wno-strict-selector-match -wno-undeclared-selector -wno-deprecated-implementations -fasm-blocks -fstrict-aliasing -wprotocol -wdeprecated-declarations -wno-sign-conversion -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/psmtabbarcontrol.hmap -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/release/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/derivedsources/x86_64 -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/derivedsources -f/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/release -include /var/folders/2x/_8nyw24s4bv5ccy2z6gf9hd80000gp/c/com.apple.xcode.502/sharedprecompiledheaders/appkit-dznbmxptlydmqxbpwpoxawqdnnsw/appkit.h -mmd -mt dependencies -mf /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmmetaltabstyle.d --serialize-diagnostics /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmmetaltabstyle.dia -c /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/source/psmmetaltabstyle.m -o /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmmetaltabstyle.o fatal error: file '/usr/include/sys/types.h' has been modified since precompiled header built 1 error generated. compilec ../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmrolloverbutton.o source/psmrolloverbutton.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler cd /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol setenv lang en_us.us-ascii /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -wno-trigraphs -fpascal-strings -os -wno-missing-field-initializers -wno-missing-prototypes -wreturn-type -wno-implicit-atomic-properties -wno-receiver-is-weak -wformat -wno-missing-braces -wparentheses -wswitch -wno-unused-function -wno-unused-label -wno-unused-parameter -wunused-variable -wunused-value -wno-empty-body -wno-uninitialized -wno-unknown-pragmas -wno-shadow -wno-four-char-constants -wno-conversion -wno-constant-conversion -wno-int-conversion -wno-enum-conversion -wno-shorten-64-to-32 -wpointer-sign -wno-newline-eof -wno-selector -wno-strict-selector-match -wno-undeclared-selector -wno-deprecated-implementations -fasm-blocks -fstrict-aliasing -wprotocol -wdeprecated-declarations -wno-sign-conversion -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/psmtabbarcontrol.hmap -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/release/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/derivedsources/x86_64 -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/derivedsources -f/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/release -include /var/folders/2x/_8nyw24s4bv5ccy2z6gf9hd80000gp/c/com.apple.xcode.502/sharedprecompiledheaders/appkit-dznbmxptlydmqxbpwpoxawqdnnsw/appkit.h -mmd -mt dependencies -mf /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmrolloverbutton.d --serialize-diagnostics /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmrolloverbutton.dia -c /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/source/psmrolloverbutton.m -o /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmrolloverbutton.o fatal error: file '/usr/include/sys/types.h' has been modified since precompiled header built 1 error generated. compilec ../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmtabbarcell.o source/psmtabbarcell.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler cd /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol setenv lang en_us.us-ascii /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -wno-trigraphs -fpascal-strings -os -wno-missing-field-initializers -wno-missing-prototypes -wreturn-type -wno-implicit-atomic-properties -wno-receiver-is-weak -wformat -wno-missing-braces -wparentheses -wswitch -wno-unused-function -wno-unused-label -wno-unused-parameter -wunused-variable -wunused-value -wno-empty-body -wno-uninitialized -wno-unknown-pragmas -wno-shadow -wno-four-char-constants -wno-conversion -wno-constant-conversion -wno-int-conversion -wno-enum-conversion -wno-shorten-64-to-32 -wpointer-sign -wno-newline-eof -wno-selector -wno-strict-selector-match -wno-undeclared-selector -wno-deprecated-implementations -fasm-blocks -fstrict-aliasing -wprotocol -wdeprecated-declarations -wno-sign-conversion -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/psmtabbarcontrol.hmap -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/release/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/derivedsources/x86_64 -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/derivedsources -f/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/release -include /var/folders/2x/_8nyw24s4bv5ccy2z6gf9hd80000gp/c/com.apple.xcode.502/sharedprecompiledheaders/appkit-dznbmxptlydmqxbpwpoxawqdnnsw/appkit.h -mmd -mt dependencies -mf /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmtabbarcell.d --serialize-diagnostics /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmtabbarcell.dia -c /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/source/psmtabbarcell.m -o /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmtabbarcell.o fatal error: file '/usr/include/sys/types.h' has been modified since precompiled header built 1 error generated. compilec ../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmprogressindicator.o source/psmprogressindicator.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler cd /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol setenv lang en_us.us-ascii /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -wno-trigraphs -fpascal-strings -os -wno-missing-field-initializers -wno-missing-prototypes -wreturn-type -wno-implicit-atomic-properties -wno-receiver-is-weak -wformat -wno-missing-braces -wparentheses -wswitch -wno-unused-function -wno-unused-label -wno-unused-parameter -wunused-variable -wunused-value -wno-empty-body -wno-uninitialized -wno-unknown-pragmas -wno-shadow -wno-four-char-constants -wno-conversion -wno-constant-conversion -wno-int-conversion -wno-enum-conversion -wno-shorten-64-to-32 -wpointer-sign -wno-newline-eof -wno-selector -wno-strict-selector-match -wno-undeclared-selector -wno-deprecated-implementations -fasm-blocks -fstrict-aliasing -wprotocol -wdeprecated-declarations -wno-sign-conversion -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/psmtabbarcontrol.hmap -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/release/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/derivedsources/x86_64 -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/derivedsources -f/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/release -include /var/folders/2x/_8nyw24s4bv5ccy2z6gf9hd80000gp/c/com.apple.xcode.502/sharedprecompiledheaders/appkit-dznbmxptlydmqxbpwpoxawqdnnsw/appkit.h -mmd -mt dependencies -mf /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmprogressindicator.d --serialize-diagnostics /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmprogressindicator.dia -c /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/source/psmprogressindicator.m -o /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmprogressindicator.o fatal error: file '/usr/include/sys/types.h' has been modified since precompiled header built 1 error generated. compilec ../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmaquatabstyle.o source/psmaquatabstyle.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler cd /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol setenv lang en_us.us-ascii /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -wno-trigraphs -fpascal-strings -os -wno-missing-field-initializers -wno-missing-prototypes -wreturn-type -wno-implicit-atomic-properties -wno-receiver-is-weak -wformat -wno-missing-braces -wparentheses -wswitch -wno-unused-function -wno-unused-label -wno-unused-parameter -wunused-variable -wunused-value -wno-empty-body -wno-uninitialized -wno-unknown-pragmas -wno-shadow -wno-four-char-constants -wno-conversion -wno-constant-conversion -wno-int-conversion -wno-enum-conversion -wno-shorten-64-to-32 -wpointer-sign -wno-newline-eof -wno-selector -wno-strict-selector-match -wno-undeclared-selector -wno-deprecated-implementations -fasm-blocks -fstrict-aliasing -wprotocol -wdeprecated-declarations -wno-sign-conversion -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/psmtabbarcontrol.hmap -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/release/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/derivedsources/x86_64 -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/derivedsources -f/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/release -include /var/folders/2x/_8nyw24s4bv5ccy2z6gf9hd80000gp/c/com.apple.xcode.502/sharedprecompiledheaders/appkit-dznbmxptlydmqxbpwpoxawqdnnsw/appkit.h -mmd -mt dependencies -mf /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmaquatabstyle.d --serialize-diagnostics /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmaquatabstyle.dia -c /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/source/psmaquatabstyle.m -o /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmaquatabstyle.o fatal error: file '/usr/include/sys/types.h' has been modified since precompiled header built 1 error generated. compilec ../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmtabdragassistant.o source/psmtabdragassistant.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler cd /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol setenv lang en_us.us-ascii /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -wno-trigraphs -fpascal-strings -os -wno-missing-field-initializers -wno-missing-prototypes -wreturn-type -wno-implicit-atomic-properties -wno-receiver-is-weak -wformat -wno-missing-braces -wparentheses -wswitch -wno-unused-function -wno-unused-label -wno-unused-parameter -wunused-variable -wunused-value -wno-empty-body -wno-uninitialized -wno-unknown-pragmas -wno-shadow -wno-four-char-constants -wno-conversion -wno-constant-conversion -wno-int-conversion -wno-enum-conversion -wno-shorten-64-to-32 -wpointer-sign -wno-newline-eof -wno-selector -wno-strict-selector-match -wno-undeclared-selector -wno-deprecated-implementations -fasm-blocks -fstrict-aliasing -wprotocol -wdeprecated-declarations -wno-sign-conversion -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/psmtabbarcontrol.hmap -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/release/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/derivedsources/x86_64 -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/derivedsources -f/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/release -include /var/folders/2x/_8nyw24s4bv5ccy2z6gf9hd80000gp/c/com.apple.xcode.502/sharedprecompiledheaders/appkit-dznbmxptlydmqxbpwpoxawqdnnsw/appkit.h -mmd -mt dependencies -mf /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmtabdragassistant.d --serialize-diagnostics /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmtabdragassistant.dia -c /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/source/psmtabdragassistant.m -o /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmtabdragassistant.o fatal error: file '/usr/include/sys/types.h' has been modified since precompiled header built 1 error generated. compilec ../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmunifiedtabstyle.o source/psmunifiedtabstyle.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler cd /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol setenv lang en_us.us-ascii /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -wno-trigraphs -fpascal-strings -os -wno-missing-field-initializers -wno-missing-prototypes -wreturn-type -wno-implicit-atomic-properties -wno-receiver-is-weak -wformat -wno-missing-braces -wparentheses -wswitch -wno-unused-function -wno-unused-label -wno-unused-parameter -wunused-variable -wunused-value -wno-empty-body -wno-uninitialized -wno-unknown-pragmas -wno-shadow -wno-four-char-constants -wno-conversion -wno-constant-conversion -wno-int-conversion -wno-enum-conversion -wno-shorten-64-to-32 -wpointer-sign -wno-newline-eof -wno-selector -wno-strict-selector-match -wno-undeclared-selector -wno-deprecated-implementations -fasm-blocks -fstrict-aliasing -wprotocol -wdeprecated-declarations -wno-sign-conversion -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/psmtabbarcontrol.hmap -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/release/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/include -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/derivedsources/x86_64 -i/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/derivedsources -f/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/release -include /var/folders/2x/_8nyw24s4bv5ccy2z6gf9hd80000gp/c/com.apple.xcode.502/sharedprecompiledheaders/appkit-dznbmxptlydmqxbpwpoxawqdnnsw/appkit.h -mmd -mt dependencies -mf /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmunifiedtabstyle.d --serialize-diagnostics /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmunifiedtabstyle.dia -c /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/source/psmunifiedtabstyle.m -o /users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmunifiedtabstyle.o fatal error: file '/usr/include/sys/types.h' has been modified since precompiled header built 1 error generated. 2013-02-20 17:00:21.728 xcodebuild[72127:4f03] dvtassertions: warning in /sourcecache/idexcode3projectsupport/idexcode3projectsupport-2108/xcode3sources/xcodeide/frameworks/devtoolsbase/pbxcore/specificationtypes/xcgccmakefiledependencies.m:87 details: failed load dependencies output contents ``/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmtabdragassistant.d''. error: error domain=nscocoaerrordomain code=260 "the file “psmtabdragassistant.d” couldn’t opened because there no such file." userinfo=0x40175cf20 {nsfilepath=/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmtabdragassistant.d, nsunderlyingerror=0x40175caa0 "the operation couldn’t completed. no such file or directory"}. user info: { nsfilepath = "/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmtabdragassistant.d"; nsunderlyingerror = "error domain=nsposixerrordomain code=2 \"the operation couldn\u2019t completed. no such file or directory\""; }. function: void xcgccmakefiledependenciesparsepathsfromrulefile(nsstring *, void (^)(nsstring *)) thread: <nsthread: 0x40175bc20>{name = (null), num = 4} please file bug @ http://bugreport.apple.com warning message , useful info can provide. 2013-02-20 17:00:21.734 xcodebuild[72127:4f03] dvtassertions: warning in /sourcecache/idexcode3projectsupport/idexcode3projectsupport-2108/xcode3sources/xcodeide/frameworks/devtoolsbase/pbxcore/specificationtypes/xcgccmakefiledependencies.m:87 details: failed load dependencies output contents ``/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmunifiedtabstyle.d''. error: error domain=nscocoaerrordomain code=260 "the file “psmunifiedtabstyle.d” couldn’t opened because there no such file." userinfo=0x400127680 {nsfilepath=/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmunifiedtabstyle.d, nsunderlyingerror=0x40172c800 "the operation couldn’t completed. no such file or directory"}. user info: { nsfilepath = "/users/mxxx/src/macvim/src/macvim/psmtabbarcontrol/../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmunifiedtabstyle.d"; nsunderlyingerror = "error domain=nsposixerrordomain code=2 \"the operation couldn\u2019t completed. no such file or directory\""; }. function: void xcgccmakefiledependenciesparsepathsfromrulefile(nsstring *, void (^)(nsstring *)) thread: <nsthread: 0x40175bc20>{name = (null), num = 4} please file bug @ http://bugreport.apple.com warning message , useful info can provide. ** build failed ** next build commands failed: compilec ../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmoverflowpopupbutton.o source/psmoverflowpopupbutton.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler compilec ../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmmetaltabstyle.o source/psmmetaltabstyle.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler compilec ../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmrolloverbutton.o source/psmrolloverbutton.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler compilec ../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmtabbarcell.o source/psmtabbarcell.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler compilec ../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmprogressindicator.o source/psmprogressindicator.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler compilec ../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmaquatabstyle.o source/psmaquatabstyle.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler compilec ../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmtabdragassistant.o source/psmtabdragassistant.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler compilec ../build/psmtabbarcontrol.build/release/psmtabbarcontrolframework.build/objects-normal/x86_64/psmunifiedtabstyle.o source/psmunifiedtabstyle.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (8 failures) make: *** [macvim] error 65

i realized there set of pre-compiled versions in alloy's github repo:

https://github.com/alloy/macvim/downloads

i downloaded build 021120112044 , working.

macvim