Posts

Showing posts from March, 2011

sql server - SQL: Proper JOIN Protocol -

i have following tables following attributes: op(opno, opname, date) opconvert(opno, m_opno, source_id, date) source(source_id, source_name, date) fleet(opno, s_no, date) i have current multiple join query gives me results want: select o.opno op_no, o.opname, o.date date_entered, c.* op o left outer join opconvert c on o.opno = c.opno left outer join source d on c.source_id = d.source_id c.opno not null the problem this. need join fleet table on previous multiple join statement attach relevant s_no multiple join table. still able accomplish using left outer join or have use different join statement? also, table join on? please note familiar left outer joins. thanks. i guess in case use inner join or left join (which same thing left outer join in sql server. inner join means return records other tables if there corresponding records (based on join condition) in fleet table. left join means return records other tables if there no corresponding rec

bash - Remove lines in file NOT containing characters in whitelist -

how remove lines in file containing characters not in whitelist? whitelisted characters: a-z a-z {}!@$%&().,;'" input: the socialist government of josé sócrates of commended. allow me final comment {please} watch tom & jerry output: all of commended. allow me final comment {please} watch tom & jerry i tried sed '/[a-za-z]{}!@$%&().,;'"/,$d' input doesn't match per character.. help? one of weirder tricks in bash match double-negative. here, print lines not contain characters not in our list: pat='a-z a-z{}!@$%&().,;"'"'" while read -r; if [[ $reply != *[^$pat]* ]]; printf '%s\n' "$reply" fi done this more commonly done when trying tell if value purely numeric ( $var != *[^0-9]* ), works here well.

php - PayPal Classic API TransactionSearch method not supported -

i'm trying use paypal's classic api transactionsearch. keep getting error 81002 unspecified method: method specified not supported. of course paypal's documentation "so" helpful. have ideas on might doing wrong? here class i'm using... api credentials loaded $this->config... <?php class paypal { private $base = array(); private $param = array(); public function __construct($registry) { $this->config = $registry->get('config'); $this->request = $registry->get('request'); // operate in sandbox or live mode? $sandbox = $this->config->get('paypal_sandbox'); $base = $this->base($sandbox); // set request parameters $param['request'] = array( 'startdate' => '2014-03-18t00:00:00-07:00z', // todo search parameter $this->request 'enddate' => '2014-03-19t14:22:23-07:00z' ); $transactions =

algorithm - Unique values of expressions using given number of 2's -

given number of 2's how many unique values can formed building expressions out of @ given number of 2's involving addition or multiplication. for example, if n = 2, can form 2 different values: 2 + 2 = 4 2 * 2 = 4 2 = 2 for n = 3, can form 4 different values (2, 4, 6 , 8): 2 * 2 * 2 = 8 2 * 2 + 2 = 6 2 + 2 * 2 = 6 2 + 2 + 2 = 6 2 * 2 = 4 2 + 2 = 4 2 = 2 i want know n, number of different possible values. i tried possible combinations , adding them hash map, n increases comibnations increase exponentially brute force won't work. need way of calculating or generalized mathematical formula. can solved using dynamic programming, because see many sub problems used repeatedly. the other answers far assume want count number of distinct expressions . answer assumes looking number of different values these expressions can evaluate to. let's have expression of size @ n . can rewrite 2 e[1] + 2 e[2] + ... + 2 e[m] e[i] >= 1

c# - Integrate non-C++ subprojects into CMake project -

i'm having bigger cmake project lot of subprojects. subprojects written in c++, no problem integrate them via add_subdirectory . there parts of project written in c# , python. both of them use visual studio solutions build them. currently we're building cmake-stuff @ first, solutions afterwards. copy created binaries respective directories in cmake install directory. lot more practical if build cmake. myproject | |--> cmakelists.txt (includes subprojects) | |--> suba (c++) |-----> cmakelists.txt | |--> subb (c++) |-----> cmakelists.txt | |--> subc (c#) |-----> subc.sln | |--> subd (python) |-----> subd.sln i integrate them directly cmake environment cannot find best way that. is there way integrate non-c++ subprojects cmake project? there best practices case? note: python solution calls script-commands convert executable. no need use solution directly in here, done via call external batch script or that. i did same in 1 of proje

sql server - VB .NET Populate DataGridView using SQL -

i wondering if willing me struggling work out how solve issue having. below give example of trying achieve. this rough example of table inside sql database: +----+----------+----------+-----------+ | id | product | state | totaltime | +----+----------+----------+-----------+ | 1 | product1 | waiting | 10 | | 2 | product1 | building | 15 | | 3 | product1 | engineer | 5 | | 4 | product1 | break | 21 | | 5 | product1 | waiting | 9 | | 6 | product2 | building | 11 | | 7 | product2 | waiting | 10 | | 8 | product2 | break | 5 | | 9 | product2 | building | 15 | +----+----------+----------+-----------+ now trying achieve group of states product using datagridview. an example below how datagridview display data: +----------+---------+----------+-------+----------+ | product | waiting | building | break | engineer | +----------+---------+----------+-------+----------+ | product1 | 19 |

android - Alert Dialog Box Leaked Error -

i create 1 alert box in android application.but first time shows correctly.in second or third time goes unexpectedly closed,please me. log cat error 03-20 05:55:27.865: e/androidruntime(4793): caused by: java.lang.illegalstateexception: cannot perform operation because connection pool has been closed. 03-20 05:55:31.055: e/windowmanager(4793): activity com.caprabo.mst.mobpaz.cardapp.activities.oldreceipts has leaked window com.android.internal.policy.impl.phonewindow$decorview{418e4990 v.e..... r.....id 0,0-388,198} added here 03-20 05:55:31.055: e/windowmanager(4793): android.view.windowleaked: activity com.caprabo.mst.mobpaz.cardapp.activities.oldreceipts has leaked window com.android.internal.policy.impl.phonewindow$decorview{418e4990 v.e..... r.....id 0,0-388,198} added here 03-20 05:55:31.055: e/windowmanager(4793): @ android.view.viewrootimpl.<init>(viewrootimpl.java:345) 03-20 05:55:31.055: e/windowmanager(4793): @ android.view.windowmanagerglobal.addview(window

nginx - Cant access the index file with the extension removed -

i'm using following rule on nginx in order remove /index.php , make hust /index when i'm browsing site folder example says no input file specified. way fixit or redirect /example /example/index ? this code i'm using remove .php extension if (!-f $request_filename){ set $rule_0 1$rule_0; } if ($rule_0 = "1"){ rewrite ^/([^.]+)$ /$1.php last; } why need "not" have extension on file, specialy index file. if example.com/index.php , use example.com/ it's same thing. webserver knows display. if want parse files no extension php files need change nginx configuration files run php cgi read files not .php or older .php3 php files, , parse them properly. (it's not advised may result in webserver problems.. nobody that)

c++ - How to react to LVN_ITEMCHANGED notification only when user finishes selecting action on multipe selection CListCtrl? -

i have dialog 2 list controls , 1 custom control graphic preview. the first has list of 1 kind of entities (1a, 1b, 1c,...) , second has list of kind of entites (2a, 2b, 2c,...), both of them multi-select. i want allow user select set of entities highlighted on preview, list last selection has been made. for example: select 1a,1b,1c -> highlight them on preview select 2a,2b,2c -> unhighlight 1a,1b,1c , highlight 2a,2b,2c if process each lvn_itemchanged notification, preview flickering, want paint preview when user finishes selection function this: void cpreviewpage::paintselection(hwnd hwnd) { m_preview.deselectall(); selectarray select; if(hwnd == m_lstfirst.getsafehwnd()) { for(int = 0; < m_lstfirst.getitemcount(); i++) { if( m_lstfirst.getitemstate(i, lvni_selected) & lvni_selected) { entity *pent = (entity *) m_lstfirst.getitemdata(i); select.append(pent); } } } else if(hwnd == m_lstseco

sqlite - Encrypted cookies in Chrome -

i working on c# forms application needs access specific cookie on computer, can fine. here's issue: google stores cookies in sqlite, , i've downloaded sqlite database browser me @ these values. surprises me half of cookie values shows empty (including 1 need), though not. the db file located at: c:\users\%username%\appdata\local\google\chrome\user data\default\cookies on chrome have addon called "edit cookie" allows me directly modify cookies on website i'm on. addon can read these cookies, , web browser can parse values through http when needed different requests, there - still, sqlite browser, , custom code both come conclusion particular value field empty. why that? somehow prevents field being read applications? i've run same problem, , code below provides working example interested. credit scherling, dpapi spot on. public class chromecookiereader { public ienumerable<tuple<string,string>> readcookies(string hostnam

javascript - Bootstrap modal bug after manual hide -

i trying make sure everytime show modal dialog, there no visible dialog. make this, i'm doing: $('.modal').modal('hide'); but doing this, when show modal dialog with: var dlg_opts = { show: true, keyboard: false, backdrop: 'static' }; if click on background (backdrop) or press escape, modal closes. when remove .modal('hide'), code works great , modal closes 'close' button. there example of modal window: <div class="modal fade" id="dlgwarning" tabindex="-1" role="dialog" aria-labelledby="dlgwarninglabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <h4 cla

json - Using mule expression to point to elements in JsonData Object -

i have inbound payload in json format. i'm converting using "json object" converter, , passing on data component (as jsondata object.) component returns same jsondata object modifications. i'm trying use amazon s3 component next step in flow, , trying tie bucket name , other values elements accessible in jsondata object. here expression bucket name instance: #[json: topkey/bucketname] from experience has worked json. however when run this, here get: message : failed invoke getobjectcontent. message payload of type: jsondata code : mule_error-29999 failed invoke getobjectcontent. message payload of type: jsondata (org.mule.api.messagingexception) org.mule.module.s3.processors.getobjectcontentmessageprocessor:177 ( http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/messagingexception.html ) is there way can use jsondata object , pull information it, or have convert else before passing on amazon s3 component?

How to display the good subscription ? Meteor JS -

i got little subscription problem doesn't stop when must. context: i have tweets collection, display client publication/subscription process. here publication: meteor.publish('tweets', function(params) { return tweets.find({hashtag: params}); }); you can see have hashtag sort them, , display tweets specified hastag. here client code subscription: var sub; template.hashtagpage.rendered = function() { // hashtag of current page hashtag = document.getelementbyid('hashtag').innerhtml; sub = meteor.subscribe('tweets', hashtag); }; template.hashtagpage.destroyed = function(){ sub.stop(); }; in template, display every tweets got subscription. same template each page display tweets. but here problem. when first go page wich display tweets hashtag #first , them without problems. if next go page display tweets hashtag #second , client display tweets hashtag #first , #second . what i'm thinking normally, .stop() on subsc

javascript - Random background image on mouse movement -

i'm not programmer, i'm capable of modifying scripts due basic programming skills. i've got css (only needs work up-to-date browsers): html { background: url(bg/random.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } what want following: read out images in "bg" directory. display random image directory background image. doing every time reload page easy , i've managed that. here comes tricky part: the random background image shall change everytime after mouse has moved distance of (let's say) 50px. ideally image should change quick transition of 100ms. basically high performance isn't issue. smoother works better. i'd happy bit of help. doesn't matter if it's php, js, jquery or whatever. to of files in directory, need use php: function directorytoarray($directory, $recursive) { $array_items = array(); if (

c - printfing a float using %d -

i wrote program intentional error in printf #include <stdio.h> int main() { double foo = 2.54f; printf("-> %d\n", foo); } and after running few times ouputs: -> 1180400440 -> 1754655672 -> 1596232744 -> -905631720 -> 202675976 -> -1580281720 -> 1020283160 -> 929827960 my question is, why output different number every time run program? because on platform, double s , int s passed functions differently. normally, double s passed in floating-point registers, while int s passed in general purpose registers. (up limit, of course; run out of registers , if there many arguments, remaining ones passed on stack.) when tell printf expect int , looks int expects find int s. gpr has not been set particular value, because when called printf , called double put floating point register. you don't need know that, although might interesting. it's undefined behaviour (ub) lie printf types of a

sql server - SQL looking up values on three joined tables -

i have table structure there cars going between buildings built on plots : cars car_id | origin | destination ---------------------------------- 1 | | c 2 | b | 3 | | b buildings build_id | plot ------------------ | 2 b | 1 c | 3 plots plot_id | coord ------------------------ 1 | "39.9,-75.5" 2 | "38.3,-74.7" 3 | "37.8,-76.1" i'm trying build query show each car , plot coordinates of origin , destination building s, this: car_id | origin_coord | dest_coord ------------------------------------------- 1 | "38.3,-74.7" | "37.8,-76.1" 2 | "39.9,-75.5" | "38.3,-74.7" 3 | "39.9,-75.5" | "39.9,-75.5" this tried don't think i'm approaching right. select * (select build_id, plot, coord buildings

php - How can I convert an absolute system path to an IShellFolder? -

i preface saying have absolutely 0 experience using coms, let alone using them through php's com extension . as part of larger project, need ishellfolder represents given absolute system path. i've done lot of googling , of solutions ran involved utilizing shgetdesktopfolder , combination of syntax differences (since examples i've seen in .net language or other) , fact desktop not ancestor of path looking confusing me. in case relevant answer, end goal use ishellfolder retrieve iextractimage given file within ishellfolder , display image on server script running on. i don't know if there special facilities in php, in c or c++ raymond chen recommends using shparsedisplayname convert absolute path pidl , , shbindtoparent gives both ishellfolder pointer , pcuitemid_child of file within folder. ( his example function getuiobjectoffile goes mile , binds object itself, though may not want) however, since makes deal pidl in addition rest, may wo

javascript - CSS3 Transitions from 'left' property to 'right' property -

i creating slider portfolio website. the issue having each section space out each other. jquery, change classes , let css handle animations. essentially, changed left property percentages. however, 10% left not equivalent 90% left have 10% left , 10% right. however, when css transitions not take account switching left right property. here website: http://devdesigned.com/intrinsecus note: @ moment, works -webkit browsers because have not gone in add other compatibility css. all boxes have same width. use margin-left:-box_width/2; , you'll have use percentage left. 85% left same 15% right. not forget add responsive design boxes won't cut off.

How to prevent the MainActivity is opened twice in Android? -

i searched solution more week situation , have not found solution. i have main activity , use fragments. in project added splash, finishes executing program opens twice. here's code: mainactivity.java package org.jotadev.nh; import org.jotadev.nh.adapter.tabspageradapter; import android.app.actionbar; import android.app.actionbar.tab; import android.app.fragmenttransaction; import android.content.intent; import android.content.sharedpreferences; import android.os.bundle; import android.support.v4.app.fragmentactivity; import android.support.v4.view.viewpager; import android.util.log; import android.view.menu; import android.view.menuinflater; import android.view.menuitem; import android.widget.toast; public class mainactivity extends fragmentactivity implements actionbar.tablistener { private viewpager viewpager; private tabspageradapter madapter; private actionbar actionbar; // tab titles private string[] tabs = { "buscar", &quo

Oracle query can't return a row even if the parameter should return a row -

i have tmp_table field receiving_institution(varchar2) . not provide other fields make simple. receiving_institution| ---------------------- 19 26 50 etc. select * tmp_table receiving_institution = '19' -> returns 0 row(unexpected result) select * tmp_table receiving_institution '%19%' -> returns row(expected result) the second query's result return receiving_institution '19' (no spaces). when edit manually '19' '19' typing it, after first query works. think it's on data itself. way test on main table (autho_activity) , it's same result.

r - Generating values of x,y for equally spaced x in an interval -

Image
i new working in r , generate values of x,y plot lowess smoothing. generate equally spaced x values in interval given function. for example, generate values function: f(x) = 5x^3 - 2x^2 -2x +1 in interval of [-5,5]. (p.s. background in biology don't understand technical things like!) you mean this f1 <- function(x) (5*x)^3 - (2*x)^2 - 2*x + 1 seqx <- seq(-5,5, = 0.1) plot(seqx, f1(seqx), pch = 20)

io - Java Standard System Input and Buffered Reader -

after trying test bufferered reader import java.io.*; public class test { public static void main(string[] args) throws ioexception{ bufferedreader br = new bufferedreader(new inputstreamreader(system.in)); if (br.readline() == "one") print1(); if (br.readline() == "two") print2(); } public static void print1(){ system.out.print("1"); } public static void print2(){ system.out.print("2"); } } nothing can type in print. if change first "if" statement to if (br.readline().startswith("one") print1(); it print "1" if type in "one". why happen? when comparing strings should change == .equals() due fact .equals() compares contents of strings each other or used compare objects. == checks reference equality or used compare primitives. changed code below: if (br.readline().equals("one")) print1(); if (br.readline().equals("two")) print2();

video - Upper limit on FFMPEG/libx264 frame sizes? -

i'm trying use ffmpeg transcode video large frames (4096 x 4096). it's short video - under 2 minutes, source video file 15.8gb. (the video animation designed projected onto planetarium domes.) the source file quicktime mov containing uncompressed photo-jpeg images (with audio, too). when tell ffmpeg transcode mov file mp4 file, says: error while opening encoder output stream #0:0 - maybe incorrect parameters such bit_rate, rate, width or height not helpful, yes, i've verified of parameters correct and/or defaults. in fact, if change requested output size 2048x2048, works fine. that's why suspect there's upper bound in encoder. i kerflummoxed. suggestions result in successful transcode appreciated. (at point willing consider alternatives ffmpeg.) the facts i run ffmpeg script: set srcfile=%1 set dstfile=%srcfile:.mov=.mp4% ffmpeg -i %srcfile% -movflags faststart -q:a 0 -q:v 0 -pix_fmt yuv420p -sws_flags gauss -s 4096x4096 %dstfile% th

pci e - Need help for pci/pcie driver configuration for interrupt -

hi writing driver openserver-6 sco operating system serial pci/pcie cards using ddi8 mp interface. facing problem while getting interrupt on pcie cards.though driver working on pci cards.is there different configuration required pcie cards? pcie has 2 different mechanisms interrupt.: 1. legacy interrupts. signalled device thought intx messages. these sometime referred level-triggered interrupt virtually reproduce pci legacy 2. message signaled interrupts(msi) , extension (msi-x). signalled mwr packets @ host specific address. you can tell mode use looking @ device configuration space. if have pciutils available on platform, lspci -vvv dump you.

c++ - gcc (mac/linux) error no matching function for call while VisualStudio compiles ok -

i've got problem cross-platform compile. code below compiles on win, mac , linux (program qt based) in order make compile on mac , linux have defined if/else. windows compiler (vs2010) finds definition mac (gcc4.2) , linux (ubuntu12lts) cant find it... any ideas? maybe im missing technical terminology in order search this? want able use "table->setmark(i,myobj());" systems doesnt seem have platform specific code. ///// .h void setmark(int row, myobj& mark) { value(row).setmark(mark); } const myobj& getmark(int row) const { return value(row).getmark(); } ///// ///// .cpp myobj obj; bool ret = false, ifhandled = false; m_root_command.evaluate(obj,ret,ifhandled); if (m_marked) { table *table = m_thisobj.gettable(); (int = 0; < table->getrowcount(); i++) { #if defined(_win32) // works in windows, fails compile // on other platforms error below table->setmark(i,myobj()); #els

signal functions does not recognized by octave 3.6.1 -

i have installed octave 3.6.1 along packages including "signal 1.1.2" when run simple example of "sigmoid_train" function error appears "sigmoid_train function undefined". can body tell me problem? the problem didn't load signal package. when type pkg list can find ones loaded asterisk in front of names. load package pkg load signal . having load packages thing many users coming matlab find strange if compare other languages, such python, perl, or c++, expect them import , use , or #include every libraries available in system default? see octave's faq more details. if want package loaded automatically default, recommended action add line pkg load signal ~/.octaverc file. finally, have started octave, should had installed octave 3.8.1.

mathdotnet - Is there a method in recent Math.Net to return the SquaredNorm of a vector? -

in old version (iridium) there method vector.squarednorm() in recent stable version of math.net there none available. what method should use? if want squared l2-norm (which iridium did if remember correctly) can square yourself: var squarednorm1 = math.pow(v.l2norm(),2); alternatively can use dot product bit shorter (and faster in case use native providers , vectors large): var squarednorm2 = v*v;

r - Use strsplit starting at end of string -

i've been using code split names of individual samples, change part of sample name, , rebind strings together. code works when names same length ( ie: names 8 characters long , splits after first 4 characters ), when names different lengths, code no longer effective. essentially, individual names 7 or 8 characters. last 4 characters what's important. example 8 characters: samp003a example 7 characters: sam003a is there way continue using strsplit separate names, start end of string rather beginning, keep last 4 characters ( 003a )? current code: > rowlist <- as.list(rownames(df1)) > rowlistres <- strsplit(as.character(rowlist), "(?<=.{4})", perl = true) > rowlistres.df <- do.call(rbind, rowlistres) > rowlistres.df[,1] <- "ly3d" > dfnames <- apply(rowlistres.df, 1, paste, collapse="") > rownames(df1) <- dfnames it's line 2 i'm trying hard edit, can split accordin

asp.net - What does aspnet keep overwritting my onclick attribute? -

i have button on form. during page_load event add new onclick attribute button via code behind. when inspect button in firefox attribute not there , being replaced with: onclick='javascript:webform_dopostbackwithoptions(new webform_postbackoptions("button_modal_search", "", true, "modalsearch", "", false, false))' here tag before run app: here's code behind: button_modal_search.attributes.add("onclick", "return showsearchspinner()") anyone know how can prevent attribute being overwritten? asp.net indeed overrides onclick attribute, provide onclientclick property allow specify own client-side behavior: button_modal_search.onclientclick = "return showsearchspinner();" if value of property constant, can specify attribute in button markup itself.

css - sizing a container based on the content -

Image
the following screen shot of content part of form validation in website project that's in development phase: this content contained in div specifies width 20%. prior adding rule div stretched horizontally across entire screen looked excessive short messages contained within. there way let div (or other appropriate container) automatically adjust width wide enough content contains? you can display: inline-block or float . here demo http://codepen.io/anon/pen/vdicu/

c++ - Storing the result of LARGE_INTEGER / LARGE_INTEGER -

i'm trying develop simple timer class game i'm making. right now, class calculate how long frame taking render fps calculations. i using window's queryperformancecounter function ( here ) highest possible resolution (i got computer's counter frequency via queryperformancefrequency) here function getting last frame's time in seconds: void update_time() { last = current; counter(&current); last_frame_time = current.quadpart - last.quadpart; last_frame_time_secs = last_frame_time / timer_frequency.quadpart; } currently, last_frame_time_secs double variable. when compile, warning: warning c4244: '=' : conversion 'longlong' 'double', possible loss of data and last_frame_time_secs 0.0. assume because result of division small doubles cannot store it? there larger data structure can use? whoops, forgot doing integer division gets rid of fractional part, no matter how you're storing :) changing last l

jquery - Check window size on load and on resize with condition -

i building script requires change entire functionality of script when window size gets under 783px, i've found solution if(jquery(document).width() < "783" && myvar=="1"){ //do things screens under 783px } but works if screen under 783px when first loaded site, want check on resize since css media queries work , gets messed up. need this: if((document).width()<783 && myvar=="1" || onresize(document.width<783) && myvar=="1"){ //do things screens under 783px } can me this? i've tried doing with jquery(window).on("resize", function () { //do things under 783px }).resize(); but doesn't seems work, if has suggestion please share. use: function check() { if ($(document).width() < 783 && myvar === "1") { // use `===` , no quote around 783 console.log("y"); } } check(); // first-time check $(window).resize(function () { // n

Developing Node.js application remotely using Eclipse -

i have remote machine running ubuntu, node.js environment setup. want develop node.js application using eclipse on local machine dev environment on remote machine. way configure same in eclipse? look @ standard eclipse remote system explorer http://marketplace.eclipse.org/content/remote-system-explorer-ssh-telnet-ftp-and-dstore-protocols it remote console , file manager. though has integration e.g. extension wizard create project on remote system, have not tried. create issue if want discuss further https://github.com/nodeclipse/nodeclipse-1/issues/

ajax - Serialize Laravel Query Builder -

i able construct query using laravel, , serialize url string. allow me create routes unserialize query builder, run query, , make view displays database results. for example, implement button refreshes list of posts made kryo: http://example.com/ajax/posts.php?name=kryo&order_by=created_at&order_type=desc posts.php route unserializes, validates, , runs query in url params, , provides results view. perhaps not useful in general, find handy ajax requests. if knows how implement laravel plugin of nature, fantastic. i'll try give basic idea: in laravel have create route make request function/method, @ first need create route listening ajax request, example: route::get('/ajax/posts', array('uses' => 'postcontroller@index', 'as' => 'showposts')); now, create link in view points route, create link may try this: $url = to_route('showposts'); if use this: <a class='ajaxpost' href=&

segmentation fault while loading data from a file in C++ -

the title of question might have been title many other questions on site, however, experiencing strangest thing i've ever had deal in whole academic life. i assigned design binary search tree database contains long list of company's employee records. have implemented project , worked fine, until received email professor asking in class log linux-powered server via ssh , verify project compiles , behaves expected on there. the source code compiled fine, however, when run application , tell load list of 3000 records of file, run segmentation fault @ 543th record (line in file). my question is: causing problem, considering code worked fine on own machine? does matter, size of project, how memory assigned me? possible running out of memory while loading data? even though 100% sure problem not in code, still think convenient @ piece of code , try spot problem. here's employee class: class employee { public: employee(){} employee(std::string first_n

html5 - What is the state of user-based audio submissions? -

does know state-of-the-art in user audio submissions? know wami recorder wondering high profile website do. instance, if site soundcloud wanted user-based audio submissions, how it? considerations encoding on client or server , encoding, flash or html5 or both, mobile, compatibility, microphone access etc... take @ roundware - may helpful: http://www.roundware.org/

github pull request from master branch, can I keep working on other branches before it is merged? -

i found quick bug fix in project. never made development branch , when finished bug fix did pull request new changes on master branch. while i'm waiting request merged found unrelated bug work on. can make new branch bug #2 , work on separately or changes included in still pending pull request first fix? is there anyway fix other waiting merged? while i'm waiting request merged found unrelated bug work on. can make new branch bug #2 , work on separately or changes included in still pending pull request first fix? yes, can make new branch: changes on remain branch only. if add , push new commits on initial branch made pr from, pr automatically updated, explain in " couple of tips pull requests ". but changes new branch wouldn't impact pr in way.

JSONP Callback not working for Beats Music API -

i'm trying use api via jsonp - making request like: https://partner.api.beatsmusic.com/v1/api/search/federated?callback=beatscallback&q=cats&client_id=xxxxx but response comes pure json - not wrapped in callback. callbacks supported? beats music supports cors allows javascript on page make requests domain, not domain originated from. thus, not need use jsonp , can access json in traditional manner.

signature files - F# denies existence of a constructor (probably type-constraint related) -

on following code, f sharp says: module xyz requires value new : (iblah<'a> * 'b) -> test<'a, 'b>') i have tried supplying exact constructor explicit new did not seem help, though intellisense though type same. expect have somehow got constraints wrong. please tell me change code compiles (without removing constraints)? many thanks. first fsi file: module xyz type iblah<'a> = abstract : 'a -> 'a type ihuha = abstract : unit -> unit type test<'a, 'b when 'a :> ihuha , 'b : comparison> = new : (iblah<'a> * 'b) -> test<'a, 'b> member huha : unit -> unit the fs file is: module xyz type iblah<'a> = abstract : 'a -> 'a type ihuha = abstract : unit -> unit type test<'a, 'b when 'a :> ihuha , 'b : comparison> (x:iblah<'a>, y:'b) = member x.huha () = printf "%o&q

ios - What do I have to do after setting contentInset or automaticallyAdjustsScrollViewInsets for it to actually beeing applied? -

i have got uiviewcontroller containing uiscrollview . automaticallyadjustsscrollviewinsets not set (so should default yes ). on user interaction set automaticallyadjustsscrollviewinsets no , can set own contentinset on scroll view. after doing nothing happens. have call afterwards? calling setneedsdisplay on scroll view doesn’t help. if want initial display of scrollview include initial content offset, set contentinset value in viewdidload . if wish dynamically change contentinset , have contentoffset change well, need adjust contentoffset @ same time contentinset. example: // adjust content inset , initial offset account header uiedgeinsets contentinset = self.collectionview.contentinset; contentinset.top += self.stickyheaderview.bounds.size.height; self.collectionview.contentinset = contentinset; if (-1 * self.collectionview.contentoffset.y < contentinset.top) { cgpoint contentoffset = self.collectionview.contentoffset; contentoffset.y = -1*conten

If in Java , not a statement error -

class box { // instance variables double length ,ipsos ; double width ,mikos ; double height ,platos; // constructors public box ( double side ) { width = side ; height = side ; length = side ; } public box ( double x , double y , double z) { platos = y ; ipsos = z; mikos = x ; } // methods double calculate(double praksi) { return 2 * ( width * height + width * length + height * length ) ; } double volume(double emvadon) { return platos*ipsos*mikos ; } @override public string tostring() { return "volume: " + volume(1) + "\n calculate: " + calculate(1); } public class cube extends box { public cube(double side) { super(side, side, side); if (side<0) { system.out,println("lathos timi);} } } } in upper code,compiler finds error on : if (side<0) { system.out,println("lathos timi);} it says : not statement what wrong? im new @ java programming , 'if' c . you have comma in println stateme

AES encryption error in java -

i try decrypt encrypted text , use code error me: exception in thread "main" java.security.invalidkeyexception: illegal key size and decryption code is: string key = "ffce885876a617e7"; string vector = "9ee153a3df56965e7baf13a7fa1075cc"; ivparameterspec ivspec = new ivparameterspec(key.getbytes()); secretkeyspec keyspec = new secretkeyspec(vector.getbytes(), "aes"); cipher cipher = cipher.getinstance("aes/cbc/nopadding"); cipher.init(cipher.decrypt_mode, keyspec, ivspec); //error occured in line .getbytes() not automagically convert "hex string" matching bytes. instead, try utility method: private static byte[] hexstringtobytes(final string input) { final int len = input.length(); if (len % 2 != 0) throw new illegalargumentexception(); final byte[] ret = new byte[len / 2]; int offset = 0; (int = 0; < ret.length; i++) { ret[i] = (byte) inte

c++ - MDI MFC VC++ how to switch views within mainframe -

i making mdi application , , without using splitter document has multiple views. want change document view mainframe of application... here doing , have outlookbar menu buttons, when user click buttons show cformview inside document child instead of popup dialog. dont know how change view mainframe menu handler has been written. kindly suggest tip if know any...there more 5 different views , 4 of them cformview. mainframe ->menuhandlerfunction (menu clicks) menuhandlerfunction -> open new document new view based on cformview (total 5 different cformview , handlers inside mainframe written) i'm not sure how select view display, here code iterate through views of current document in mainframe: edit: modified code mdi cmdichildwnd *pchild = (cmdichildwnd*)getactiveframe(); // edit: added line cdocument *pdoc = pchild->getactivedocument(); // edit: added pchild-> position pos = pdoc->getfirstviewposition(); while (pos != null) { c

python - How could I set hwm in the push/pull pattern of zmq? -

i have found similar question, zeromq: hwm on push not work , couldn't solve problem. i want control number of messages push socket queues, doesn't work , still queues 1000 messages. want know how set hwm of push socket. in advance. my environment is: libzmq 4.0.4, pyzmq 14.1.0, python 3.3 here's code: server.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- import random import zmq class testpush(object): def __init__(self): self.ctx = zmq.context() random.seed() def run(self): task_snd = self.ctx.socket(zmq.push) task_snd.setsockopt(zmq.sndhwm, 10) task_snd.bind('tcp://*:53000') while true: workload = str(random.randint(1, 100)) task_snd.send(workload.encode('utf-8')) print('send {0}'.format(workload)) if __name__ == '__main__': test_push = testpush() test_push.run() client.py #!/usr/bin/env python3 #