Posts

Showing posts from April, 2012

algorithm - What is the best structure to find which AABB boxes in a dynamic set collide with an arbitrary AABB box? -

i have set of dynamic aabb boxes positions , sizes updated continuously. structure can use aabb boxes of colliding arbitrary aabb box? use dynamic aabb tree. here's source code + documentation (cpp files @ bottom of page)

javascript - IE8 iframe renders simple text file as HTML , I need raw code -

i have iframes need show codefiles. codefiles have .txt extention , should show code text. works on browsers except ie8. ie8 keeps rendering code files html. <iframe id="codefile222" width="100%" height="200px" marginheight="0" frameborder="0" src="http://mrsbos.wikispaces.com/file/view/guessnumber.txt" name="codefile222" onload="autoresize('codefile222');changecolor('codefile222')" > any idea this, make work in ie8 the content-type http header indicates mime type of resource (a web page, image, or download). html pages, mime type text/html , , text files, text/plain . the server send text/plain;charset=utf-8 text files (as, example, shown in firebug 's net panel when performing hard reload of file using ctrl + f5 ). however, internet explorer, unlike other web browsers, see html in file , second-guess server ( microsoft docume...

google apps script - Display Spreadsheet data in Sites with Html Service -

i displaying want similar tutorial instead of using ui services display table, use html services. question mentioned use templated html display spreadsheet data in html. elaborated on topic? simple example this helpful because i'd see demonstration on works. thank you! there simple example of using templated html display table spreadsheet data available in documentation, here . i've published a running copy , utilizing same data waqar's tutorial, easy comparison. source spreadsheet here , script. (edit: script provided below.) code.gs // code in script copied // https://developers.google.com/apps-script/guides/html-service-templates function doget() { return htmlservice .createtemplatefromfile('index') .evaluate(); } function getdata() { return spreadsheetapp .openbyid('0avf9feyqxfxadeplrhp5dgc4q1e3oxmyv2s4rktiqwc') .getdatarange() .getvalues(); } index.html <? var data = getdata(); ?> ...

sdl - How to blit a text surface on SDL_Overlay? -

i'm newbie in sdl. question: create text surface use sdl_ttf.dll. ttf_font* myfont = ttf_openfont(szfontpath, text.m_ifontsize); sdl_surface *textsurface = ttf_renderunicode_blended(myfont, (const uint16*)text.m_wstrfilepath.c_str(), textcolor); this works fine , textsurface ok if blit on screen,which used play video. sdl_blitsurface(textsurface , null, screen, offset); problem text on screen keep blinking in every 3 /4 seconds, set screen sdl_doublebuf , sdl_hwsurface, not help. went way.i decide blit text on screen before display. use function: blitsurface2yuv(text, vp->bmp, &rectoffset); //vp->bmp sdl_overlay display it: sdl_displayyuvoverlay(vp->bmp, &rcrview); //rcview offset screen "blitsurface2yuv" defined here: int blitsurface2yuv(sdl_surface *src, sdl_overlay *dst, sdl_rect *dstrect) { uint8 r, g, b; int y1,u1,v1; int y,x; int height = src->h < dstrect->h ? src->h: dstrect->h; int ...

Use of Anonymous Inner Class in java -

public samplebehaviour otherway(final string st) { return new samplebehaviour() { private string str = st; @override public void print() { system.out.println("val:"+val); } }; } samplebehaviour interface. classes implements interface must define methods behavior, whats use of variables in interface? why method parameter need final? don't real time application type of usage? what's real thing behind this? if it's useful, why doesn't c++ have this? from the java language specification , section 8.1.3: any local variable, formal parameter, or exception parameter used not declared in inner class must declared final. wikipedia says it's inner class needs keep own copy of variable since can live on after outer class goes out of scope; prevent having same variable name refer 2 different locations, forced variable fixed in place.

xcode - How do i use this code to Display the UUID in a Label? -

can willing explain steps beginer me? trying lean things seem above head :( lol here code have, need label display uuid right application opened. (i using storyboard) code: + (nsstring *)createuuid { nsstring *uuidstring = nil; cfuuidref uuid = cfuuidcreate(null); if (uuid) { uuidstring = (nsstring *)cfbridgingrelease(cfuuidcreatestring(null, uuid)); cfrelease(uuid); } return uuidstring; } try nslogging uuid string if correct add yourlabel.text = uuidstring. guessing have connected labels correctly. if yes, should work.

ios - Do all UIVIewControllers come with a UINavigationController, UISearchDisplayController, etc? -

i noticed uiviewcontroller have properties like self.navigationcontroller self.searchdisplaycontroller etc. confused me bit. did not define these in xib file - notice can access , use them , automatically show in view. reason having these instantiated view controllers? what if want define , hook own via xib file? those values nil default. return values if view controller has been setup corresponding controller. in other words, if view controller has not been added nav controller navigationcontroller property returns nil . same searchdisplaycontroller .

hibernate cannot read view with null column -

i have view reads table null columns. have hibernate code reads view. issue hibernate not able read record due null value. looking @ logs see following debug [http-bio-8080-exec-1][2013-05-20 23:34:16,243][nullabletype.java:166] - returning null column: address19_0_ it able read non null columns when comes address null in case throws exception. why hibernate not able read this? i generating pojo , hbm.xml file using eclipse hibernate tool. here build.xml hibernate tool <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.hibernatetooltask"> <classpath> <fileset dir="c:\eclipse\order\webcontent\web-inf\lib"> <include name="**/*.jar" /> </fileset> </classpath> </taskdef> <target name="gen_hibernate" description="generate hibernate classes"> <hibernatetool destdir="c:\eclipse\order\gencode"> ...

android - How to implement swipe gestures on listview -

Image
i beginner android. want learn how implement following. check image: here want implement: as shown in figure, need swipe listview left - - right , viceversa. have display data according date. when activity starts, list items shown according current date. if swipe listview right left tommorrows date should displayed in date tab , data set of listview should contain items of tommorrows date. similarly, when swiping left right, previous date should shown , data related previous date listed in listview. my applicaion has minimum sdk of android 2.2 please me implement this. in advance. use viewpager depending on needs.....check out.. http://developer.android.com/reference/android/support/v4/view/viewpager.html http://developer.android.com/training/animation/screen-slide.html https://github.com/jakewharton/android-viewpagerindicator there lot of tutorials......

ios - Using Cocos2D Dynamic Texture as background for View Controller -

i have dynamic texture created ccrendertexture . use in top half of 1 of view controllers in app. currently have: one app viewcontroller has 2 uibuttons on it one app dynamic texture built (similar tutorial: http://www.raywenderlich.com/3857/how-to-create-dynamic-textures-with-ccrendertexture ) so need take dynamic texture, , place upper 25% of view controller in app has 2 uibutton s in view controller. how go doing this? need somehow subview view controller has 2 uibutton s? i'm assuming put dynamic texture background somehow, , lay view 2 uibutton s on top of it. i'm not totally sure. per learncocos2d response above, followed advice: best use cocos2d sprite , make view controller's view transparent (opaque = no). or use render textures getuiimage method: learn-cocos2d.com/api-ref/latest_2.x/cocos2d-iphone/html/… note costly operation

java - Sorting Table is wrong when the sort button be pressed more than once? -

Image
i have problem here. create program add data table , sort when press button. when press sort button once, isn't wrong. when press again wrong. why? please me. code. nama class public class nama { private string nama; private int index; public nama(string n,int i){ nama=n;index=i; } void setdata(string n,int i){ nama=n;index=i; } string nama(){ return nama; } int ind(){ return index; } public string tostring(){ return(string.format("%s %d", nama,index)); } } mergesort class import java.util.*; public class mergesorts{ public void merge_sort(int low,int high,nama [] a){ int mid; if(low<high) { mid=(low+high)/2; merge_sort(low,mid,a); merge_sort(mid+1,high, a); merge(low,mid,high,a); } } public void merge(int low,int mid,int...

Invalid Column Name errors in dynamic query. Works in SQL Server 2008 but not in SQL Server 2012 -

i'm in middle of going sql server 2008 (not r2) sql server 2012. i've restored database sql server 2012 i'm getting runtime errors trying call dynamic query. when call query asp, i'm getting 500 error, , in logs says have invalid column name 'vendor'. when run same procedure directly in ssms tells me have following errors: msg 207, level 16, state 1, line 46 invalid column name 'vendor'. msg 207, level 16, state 1, line 46 invalid column name 'type'. msg 207, level 16, state 1, line 46 invalid column name 'subtype'. msg 207, level 16, state 1, line 46 invalid column name 'custprice'. here's code in stored procedure. problem occurring when @mode = 'search' : alter procedure [dbo].[spproductsearch] @idcompany int = 0, @idbusiness int = 0, @cat int = 0, @subcat int = 0, ...

mongodb - mongo group query how to keep fields -

everybody. in mongo group query, result shows key(s) in arguments. how keep first document in each group mysql query group. example: ------------------------------------------------------------------------- | name | age | sex | province | city | area | address | ------------------------------------------------------------------------- | ddl1st | 22 | 纯爷们 | beijing | beijing | chaoyang | qingnianlu | | ddl1st | 24 | 纯爷们 | beijing | beijing | xuhui | zhaojiabanglu | | 24k | 220 | ... | .... | ... | ... | ... | ------------------------------------------------------------------------- db.users.group({key: { name: 1},reduce: function ( curr, result ) { result.count ++ },initial: {count : 0 } }) result: [ { "name" : "ddl1st", "count" : 1 }, { "name" : "24k", "count" : 1 } ] how following: [ { "name" : "ddl1st", ...

html - Creating a 2 Column Layout in CSS -

Image
i working on interface small web module , having problems css. right have container div , tables layout sub-sections. floating 3 of tables left , 3 tables right, until has worked great. i added feature allows additional fields added user needed , height of table in right column grows, breaks layout. there better way layout won't break? after adding "clear:left" , "clear:right" each table, appears follows... after moving 3 left floated tables top of code , removing "float:right/clear:right" other 3, works except this. for each float left, add clear:left, each float right, add clear: right. it'd depend on order of each floated container though. option try keeping 1 set of floats 1 column (i.e. float lefts or float rights) , remove float property others in other column wrap side of floated boxes. edit: working example: http://cssdesk.com/xan5j

Eclipse Indigo - Unable to Install PHP Plugin -

i'm getting error message error occurred while collecting items installed while installing php plugin in eclipse indigo. can provide me exact link install php plugin in eclipse indigo sr2? open eclipse , go help-> software updates-> find , install select "search new features install" , click "next" create new remote site following details: name: pdt url: http://download.eclipse.org/tools/pdt/updates/release check pdt box , click "next" start installation hope helps

What is the ideal Grails class domain for this tree structure -

i'm developing website need categories sub categories. my current domain class is: package com.abc class category { string title string description category parent static hasmany = [children: category, listing: listing] static constraints = { title blank: false description blank: true } } but gives me error: property [children] in class [class com.abc.category] bidirectional one-to-many 2 possible properties on inverse side. either name 1 of properties on other side of relationship [category] or use 'mappedby' static define property relationship mapped with. example: static mappedby = [children:'myprop'] i use category parent . can children category.findallbyparent . easiest solution use later on in tree creation.

c# - go to a page index corresponding to a specific record in a gridview -

hello working on web page written in asp , c# , can add, edit , delete records database . web page has grid view contains select, edit , delete links in each row, , rows ordered dates. question is: how can insert new record, , automatically go corresponding page? (taking example grid view page size 5) this part of grid view <asp:gridview id="grdschedulerapplications" runat="server" autogeneratecolumns="false" visible="false" showfooter="true" pagesize="5" datakeynames="sa_id, sa_applicationid" allowpaging="true" onrowcommand="grdschedulerapplications_rowcommand"> <columns> <asp:templatefield headertext="application" headerstyle-horizontalalign="left"> <edititemtemplate> ...

ios - How to make a superview resize automatically same size and coordinate with its subview? -

Image
i have uiview contains uiimageview . want make uiview same size , same coordinate uiimageview . how can it? to auto resize programatically. at first uncheck autolayout here screen shot. the add code auto resize > myview.autoresizingmask=uiviewautoresizingflexiblewidth; myview.autoresizingmask=uiviewautoresizingflexibleheight;

json - Jquery Mobile: created a button with JQuery, trying to attach click function to it -

i retrieving data remote server via json , attaching button it: $.getjson('http://www.mysite.com/jsond1.php', function(data){ jsonobject=eval(data); day1content = jsonobject.json1; //append div $('#showday1').append(day1content); //create button, add value var input = '<input type="button" class="save_event" value="save program" />'; //attach button $('.event').append(input); this works fine. want attach event button, ie: $('.save_event').click(function() { console.log("here"); }); and when place directly below script above nothing happens. know why occuring? need to special jquery mobile? you should use following: // new way (jquery 1.7+) - .on(events, selector, handler) $('.event').on('click', '.save_event', function(e...

visual studio - How to export C++ class as a dll? -

this question has answer here: exporting c++ class dll 6 answers i came c#/java background, i'm trying figure out how create c++ dll behaves similar c# dll. i have experimented __declspec(dllexport) , __declspec(dllimport) , have managed work on static methods. sure due limited understanding. how can export classes in c++ (in entirety including private members) , able instantiate them on referencing end c#? pointer online resources/tutorial it. i started using mfc dll template, , have no idea 90% of them , why i'm inheriting cwinapp. tried tag class ccpppracticelibraryapp no longer compile. // cpppracticelibrary.h : main header file cpppracticelibrary dll // #pragma once #ifndef __afxwin_h__ #error "include 'stdafx.h' before including file pch" #endif #include "resource.h" // main symbols #ifdef ccpppract...

how to convert a VML to SVG or VML to a bitmap image by java code? -

i've been looking long time way have bitmap vml document.i have no problem except ie (of course) because i'm using ext-js pie chart make chart svg on ie 9 making vml @ ie8. use following process: choose xslt processor convert vml svg via vml2svg.xsl , dependencies convert svg bufferedimage using batik or svg salamander save bufferedimage bitmap references how buffererimage svg? how make color transparent in bufferedimage , save png svg salamander source: imagesvg.java

sql - Update related table (Postgres) -

i creating 2 table in postgres. 1st table have 1 primary column , other columns & in 2nd table have 1 primary column "mleaseid" column same in 1st table (not primary of 1st table) , others column. how copy data 1st table column second column data? create table leasetype ( "leasetypeid" integer not null , "mleaseid" character varying(45) not null, "resident" integer not null, "business" integer not null, "rarea" float null, "barea" float null, "rrent" double null, "brent" double null, primary key (leasetypeid) ); create table masterlease ( "srno" integer unsigned not null, "mleaseid" varchar(45) not null, "extid" integer unsigned not null, "mplotno" character varying(45) not null, "dplotno" character varying(45) not null, "sheetno" character varying(45) not null, "nastino" chara...

jquery - Text Matching not working for Arabic issue may be due to regex for arabic -

i have been working add functionality multilingual website have highlight matching tag keywords. this functionality works english version doesn't not fire arabic version. i have set sample on jsfiddle sample code function highlightkeywords(keywords) { var el = $("#article-detail-desc"); var language = "ar-ae"; var pid = 32; var issueid = 18; $(keywords).each(function() { // var pattern = new regexp("("+this+")", ["gi"]); //breaks html var pattern = new regexp("(\\b"+this+"\\b)(?![^<]*?>)", ["gi"]); //looks match outside html tags var rs = "<a class='ad-keyword-selected' href='http://www.alshindagah.com/ar/search.aspx?language="+language+"&pageid="+pid+"&issue="+issueid+"&search=$1' title='seach website for: $1'...

How to select row data as column in Oracle -

Image
i have 2 tables bellow shows figures i need select records bellow shown figure. ah_id need join in second table , att_id column header , att_dtl_str_value need column relevant value required output sounds have entity-attribute-value data model relational dbs aren't best @ modeling . may want key-value store . however, justin suggested, if you're using 11g can use th pivot clause follows: select * ( select t1.ah_id, t1.ah_description, t2.att_id, t2.att_dtl_str_value t1 left outer join t2 on t1.ah_id = t2.ah_id ) pivot (max(att_dtl_str_value) (att_id) in (1)); this statement requires hard-code in att_id there ways dynamically. more info can found here .

java - AI: Graph search and A* implementation with Manhattan Heuristic -

this project ai course @ university of florence. have solve classic game: sliding puzzle 8 , 15 cell. implementation of general graph search algorithm: public abstract class graphsearch implements searchalgorithm { protected queue<node> fringe; protected hashset<node> closedlist; public graphsearch() { fringe = createfringe(); closedlist = new hashset<node>(100); } protected abstract queue<node> createfringe(); public int getnodeexpanded() { return closedlist.size(); } @override public solution search(puzzle puzzle) { fringe.add(new node(puzzle.getinitialstate(), null, null)); while (!fringe.isempty()) { node selectednode = fringe.poll(); if (puzzle.getgoaltest().isgoalstate(selectednode.getstate())) { return new solution(selectednode, getnodeexpanded()); } closedlist.add(selectednode); linkedlist<node> expansion = selectednode.expandnode(); (node n : expansion) { ...

PHP forms clearing after sumbit -

i want able clear fields after , when sends form server mail. instead input remains. after refresh. echo out javascript call form.reset() when page load completes. may want use $_get parameter identify when should (e.. after successful post request same uri).

c# - null values in NHibernate returning list -

i'm trying understand following behaviour of nhibernate , can't. session.createcriteria<param>() .add(restrictions.eq("groupid", groupid)) .add(restrictions.eq("paramid", paramid)) .list<param>() this construction should return collection 1 database row(object). returns list single null element. suggest why? p.s. param class mapping has composite key. public class param { public param() { } public param(string groupid, string paramid, string paramname) : this() { groupid = groupid; paramid = paramid; paramname = paramname; } public virtual string groupid { get; protected set; } public virtual string paramid { get; protected set; } public virtual string paramname { get; protected set; } public virtual string value { get; set; } public override bool equals(object obj){...} public override int gethashcode(){...} } public class parammap : classmap<param>...

How to get the instance of running java application through jsp? -

i have java application have open apis. want use apis jsp page. don't have idea this.as of understanding have instance of running java application. please correct me if wrong. you have import class @ top of jsp <%@ page import="my.class.path.myclass" %> see how import classes in jsp? details. then can use class in code this: <% myclass myclassinstance = new myclass(); myclassinstance.mymethod(); %> if want output can use: <%= myclassinstance.amethodthatreturnsastring() %> the method can return (but must return something). if not string handled other non-string value in expression: "begin " + amethodthatreturnssomething() + " end"; so, int displayed int , object gets tostring() called etc.

java - In-place editing with GwtQuery -

how in-place editing gwtquery ? are there plugins available? similar xeditable: http://vitalets.github.io/x-editable/demo.html where there jquery-ui plugin it. unfortunately gwtquery , jquery cannot share plugins. x-editable has ported gwt before use in gquery. if interested on contributing gquery plugins it's welcome. there project, though, port jquery plugins gquery reusing original js plugin code. module called jsquery , advanced.

PHP: Why isn't exec() returning output? -

i'm writing php script used check network connections linux shell command ping calling php's exec() : <?php // bad ip domain testing. $domain_bad = "lksjdflksjdf.com"; $ip_address = $domain_bad; exec("ping -c 1 $domain_bad", $output, $return_var); var_dump($return_var); echo "return_var is: $return_var" . "\n"; var_dump($output); exit; ?> i'm not getting output error message ping in $output i'm expecting: $ php try.php ping: unknown host lksjdflksjdf.com int(2) return_var is: 2 array(0) { } if domain domain, such yahoo.com, $output has output ping in array. if it's error such 'ping: unknown host lksjdflksjdf.com' doesn't returned $output array. why happening , there better method this? you should redirect stderr stdout. to that, change exec() call this: exec("ping -c 1 $domain_bad 2>&1", $output, $return_var); more info 2>&1 meaning here . ...

java - How to keep date info? -

in java, want know best practice keep date info display, query, report etc. seems if persist long, timezone dependency removed , keep 'persist globally, display locally' principle since date object automatically converts long current timezone. but advantage of persisting date object? loose info other info owner's timezone? can wrong info when dls takes account? difference between persisting utc date , long readable db info? depending on database should use either timestamp timezone or convert utc time , store long . the first 1 relies on db handle correctly (the db will, db driver? have test setup). second 1 makes manual process, correct result in end have more hazzle because have take care everything. inside java might want use calendar on date because there can specify timezone etc. manually, able display dates in timezones different own easier.

connect my local git repository with github forked repository? -

i created private & local repository using git clone --bare $upstream (detailed here how create git repository on server github server? ) at time, didn't think contributing original github repo. ($upstream) , found out pull requests possible github repository. so question how can contribute original github repo? i wonder if following strategy possible: i create github fork $upstream (the original opensource github repo) somehow teach local repo new github fork(as did git remote add ) create branch(mywork) on local clone, work, , push new github fork pull requests original repo auther. edit since there many modifications(commits) in private repo, i need way go current $upstream's clean state (upstream's master without local modification made in origin/master , not in mywork). (so pull request doesn't have modification except branch(for pull request)) how can that? took me long time figure out.. there...

Sql transaction c# - exits try when ExecuteNonQuery() is run -

i'm trying implement sql transaction, however, i've run bit of bother. have simple database has 3 tables. users, post , comments. wish implement delete button delete user users table. initial problem had needed remove users fk both post , comment table, remove user user table. looked online , had suggested using transaction multiple server calls. here code: public void deleteuser(int userid) { using (sqlconnection con = new sqlconnection(connectionstring)) { con.open(); sqltransaction sqltran = con.begintransaction(); try { using (sqlcommand command = new sqlcommand("delete comment userid = " + @userid, con)) { sqlparameter userid = new sqlparameter("@userid", sqldbtype.int); userid.value = userid; command.executenonquery(); } using (sqlcommand command = new sq...

ruby on rails 3 - How to display a list of following users/followers? -

i'm trying display user's following , followers, not work reason , not throw error messages. here's code: following , followers action in users_controller.rb: def following @title = "following" @user = user.find(params[:id]) @users = @user.following(user) render 'following' end def followers @title = "followers" @user = user.find(params[:id]) @users = @user.followers(user) render 'followers' end following.html.haml provide(:title, @title) content_for(:side_bar) do %section %span= link_to "view profile", @user %section = render 'users/stats' if @users.any? %ul.users = render @users else %p you aren't following yet. _stats.html.haml @user ||= current_user provide(:title, @title) content_for(:side_bar) do %section = gravatar_for @user %h1= @user.name .stats %table.info %tr %td %a{:href => tweets_path(@tweet)} %strong#tweet.stat = ...

php - Why does PayPal intermittently give SSL errors? -

i'm using paypal take payments on website. 30% of ipns bail out following curl error. works fine other 70% of time. unknown ssl protocol error in connection www.paypal.com:443 i've tried using sslv3 no avail. here php curl settings, based on micah carrick's ipn listener script . <?php curl_setopt($ch, curlopt_ssl_verifypeer, true); curl_setopt($ch, curlopt_ssl_verifyhost, 2); curl_setopt($ch, curlopt_cainfo, dirname(__file__)."/cert/api_cert_chain.crt"); curl_setopt($ch, curlopt_url, 'https://www.paypal.com/cgi-bin/webscr/' ); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_postfields, $encoded_data); curl_setopt($ch, curlopt_followlocation, false); curl_setopt($ch, curlopt_timeout, 45); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_header, true); not sure. we're not seeing on our end. can change 'curlopt_url' https://ipnpb.paypal.com/cgi-bin/webscr , try little bit?

c# - Setting up different connection strings for different user in an ASP.NET MVC 3 Web App + Ninject + EF -

i'm trying figure out how set different connection string upon each web request. this scenario: one single webapp based on asp.net mvc 3 + ninject + entity framework one single entity model three phisically different databases same model what i've tried far set default controller factory (passing right connection string) overriding onactionexecuting method of base controller (every controller inherited custom base) if try access 2 different users should access different databases @ same time doesn't work. seems first user set connection string , second 1 pick 1 it's set without setting new default controller. here's code... // base controller public class basecontroller : controller { protected override void onactionexecuting(actionexecutingcontext filtercontext) { var database = string.empty; switch (request.url.host) { case "aaa.domain.local": database = "aaa"; ...

z3 - using of z3_update_term function for term updating -

the following code changes 2 3 in expression e1 . context z3_cont; expr x = z3_cont.int_const("x"); expr e1 = (x==2); expr e2 = (x==3); z3_ast ee[2]; ee[0]=e1.arg(0); ee[1]=e2.arg(1); e1 = to_expr(z3_cont,z3_update_term(z3_cont,e1,2,ee)); is possible easier? unfortunately, code e1.arg(1) = e2.arg(1) doesn't work. second question how change expressions on arbitrary depth of z3_ast, example e1.arg(1).arg(0) = e2.arg(1).arg(1) ? you can use z3_substitute api. here example: void substitute_example() { std::cout << "substitute example\n"; context c; expr x(c); x = c.int_const("x"); expr f(c); f = (x == 2) || (x == 1); std::cout << f << std::endl; expr two(c), three(c); 2 = c.int_val(2); 3 = c.int_val(3); z3_ast from[] = { 2 }; z3_ast to[] = { 3 }; expr new_f(c); // replaces expressions in in f. // third argument size of arrays , to. new_f = to_expr...